|
Ruby
2.0.0p247(2013-06-27revision41674)
|
#include "ruby/ruby.h"#include "ruby/st.h"#include "ruby/encoding.h"#include "internal.h"#include "node.h"#include "parse.h"#include "id.h"#include "regenc.h"#include <stdio.h>#include <errno.h>#include <ctype.h>#include "probes.h"#include "id.c"#include "ruby/regex.h"#include "ruby/util.h"#include "lex.c"Go to the source code of this file.
Macros | |
| #define | PARSER_DEBUG 0 |
| #define | YYDEBUG 1 |
| #define | YYERROR_VERBOSE 1 |
| #define | YYSTACK_USE_ALLOCA 0 |
| #define | numberof(array) (int)(sizeof(array) / sizeof((array)[0])) |
| #define | YYMALLOC(size) rb_parser_malloc(parser, (size)) |
| #define | YYREALLOC(ptr, size) rb_parser_realloc(parser, (ptr), (size)) |
| #define | YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (size)) |
| #define | YYFREE(ptr) rb_parser_free(parser, (ptr)) |
| #define | malloc YYMALLOC |
| #define | realloc YYREALLOC |
| #define | calloc YYCALLOC |
| #define | free YYFREE |
| #define | REGISTER_SYMID(id, name) register_symid((id), (name), strlen(name), enc) |
| #define | is_notop_id(id) ((id)>tLAST_OP_ID) |
| #define | is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) |
| #define | is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) |
| #define | is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) |
| #define | is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET) |
| #define | is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST) |
| #define | is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS) |
| #define | is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK) |
| #define | id_type(id) (is_notop_id(id) ? (int)((id)&ID_SCOPE_MASK) : -1) |
| #define | is_asgn_or_id(id) |
| #define | DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit) |
| #define | IS_lex_state_for(x, ls) ((x) & (ls)) |
| #define | IS_lex_state(ls) IS_lex_state_for(lex_state, (ls)) |
| #define | BITSTACK_PUSH(stack, n) ((stack) = ((stack)<<1)|((n)&1)) |
| #define | BITSTACK_POP(stack) ((stack) = (stack) >> 1) |
| #define | BITSTACK_LEXPOP(stack) ((stack) = ((stack) >> 1) | ((stack) & 1)) |
| #define | BITSTACK_SET_P(stack) ((stack)&1) |
| #define | COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n)) |
| #define | COND_POP() BITSTACK_POP(cond_stack) |
| #define | COND_LEXPOP() BITSTACK_LEXPOP(cond_stack) |
| #define | COND_P() BITSTACK_SET_P(cond_stack) |
| #define | CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n)) |
| #define | CMDARG_POP() BITSTACK_POP(cmdarg_stack) |
| #define | CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack) |
| #define | CMDARG_P() BITSTACK_SET_P(cmdarg_stack) |
| #define | DVARS_INHERIT ((void*)1) |
| #define | DVARS_TOPSCOPE NULL |
| #define | DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl)) |
| #define | POINTER_P(val) ((VALUE)(val) & ~(VALUE)3) |
| #define | VTBL_DEBUG 0 |
| #define | STR_NEW(p, n) rb_enc_str_new((p),(n),current_enc) |
| #define | STR_NEW0() rb_enc_str_new(0,0,current_enc) |
| #define | STR_NEW2(p) rb_enc_str_new((p),strlen(p),current_enc) |
| #define | STR_NEW3(p, n, e, func) parser_str_new((p),(n),(e),(func),current_enc) |
| #define | ENC_SINGLE(cr) ((cr)==ENC_CODERANGE_7BIT) |
| #define | TOK_INTERN(mb) rb_intern3(tok(), toklen(), current_enc) |
| #define | yyerror(msg) parser_yyerror(parser, (msg)) |
| #define | YYLEX_PARAM parser |
| #define | lex_strterm (parser->parser_lex_strterm) |
| #define | lex_state (parser->parser_lex_state) |
| #define | cond_stack (parser->parser_cond_stack) |
| #define | cmdarg_stack (parser->parser_cmdarg_stack) |
| #define | class_nest (parser->parser_class_nest) |
| #define | paren_nest (parser->parser_paren_nest) |
| #define | lpar_beg (parser->parser_lpar_beg) |
| #define | brace_nest (parser->parser_brace_nest) |
| #define | in_single (parser->parser_in_single) |
| #define | in_def (parser->parser_in_def) |
| #define | compile_for_eval (parser->parser_compile_for_eval) |
| #define | cur_mid (parser->parser_cur_mid) |
| #define | in_defined (parser->parser_in_defined) |
| #define | tokenbuf (parser->parser_tokenbuf) |
| #define | tokidx (parser->parser_tokidx) |
| #define | toksiz (parser->parser_toksiz) |
| #define | tokline (parser->parser_tokline) |
| #define | lex_input (parser->parser_lex_input) |
| #define | lex_lastline (parser->parser_lex_lastline) |
| #define | lex_nextline (parser->parser_lex_nextline) |
| #define | lex_pbeg (parser->parser_lex_pbeg) |
| #define | lex_p (parser->parser_lex_p) |
| #define | lex_pend (parser->parser_lex_pend) |
| #define | heredoc_end (parser->parser_heredoc_end) |
| #define | command_start (parser->parser_command_start) |
| #define | deferred_nodes (parser->parser_deferred_nodes) |
| #define | lex_gets_ptr (parser->parser_lex_gets_ptr) |
| #define | lex_gets (parser->parser_lex_gets) |
| #define | lvtbl (parser->parser_lvtbl) |
| #define | ruby__end__seen (parser->parser_ruby__end__seen) |
| #define | ruby_sourceline (parser->parser_ruby_sourceline) |
| #define | ruby_sourcefile (parser->parser_ruby_sourcefile) |
| #define | current_enc (parser->enc) |
| #define | yydebug (parser->parser_yydebug) |
| #define | ruby_eval_tree (parser->parser_eval_tree) |
| #define | ruby_eval_tree_begin (parser->parser_eval_tree_begin) |
| #define | ruby_debug_lines (parser->debug_lines) |
| #define | ruby_coverage (parser->coverage) |
| #define | yyparse ruby_yyparse |
| #define | rb_node_newnode(type, a1, a2, a3) node_newnode(parser, (type), (a1), (a2), (a3)) |
| #define | cond(node) cond_gen(parser, (node)) |
| #define | logop(type, node1, node2) logop_gen(parser, (type), (node1), (node2)) |
| #define | value_expr(node) value_expr_gen(parser, (node) = remove_begin(node)) |
| #define | void_expr0(node) void_expr_gen(parser, (node)) |
| #define | void_expr(node) void_expr0((node) = remove_begin(node)) |
| #define | void_stmts(node) void_stmts_gen(parser, (node)) |
| #define | reduce_nodes(n) reduce_nodes_gen(parser,(n)) |
| #define | block_dup_check(n1, n2) block_dup_check_gen(parser,(n1),(n2)) |
| #define | block_append(h, t) block_append_gen(parser,(h),(t)) |
| #define | list_append(l, i) list_append_gen(parser,(l),(i)) |
| #define | list_concat(h, t) list_concat_gen(parser,(h),(t)) |
| #define | arg_append(h, t) arg_append_gen(parser,(h),(t)) |
| #define | arg_concat(h, t) arg_concat_gen(parser,(h),(t)) |
| #define | literal_concat(h, t) literal_concat_gen(parser,(h),(t)) |
| #define | new_evstr(n) new_evstr_gen(parser,(n)) |
| #define | evstr2dstr(n) evstr2dstr_gen(parser,(n)) |
| #define | call_bin_op(recv, id, arg1) call_bin_op_gen(parser, (recv),(id),(arg1)) |
| #define | call_uni_op(recv, id) call_uni_op_gen(parser, (recv),(id)) |
| #define | new_args(f, o, r, p, t) new_args_gen(parser, (f),(o),(r),(p),(t)) |
| #define | new_args_tail(k, kr, b) new_args_tail_gen(parser, (k),(kr),(b)) |
| #define | ret_args(node) ret_args_gen(parser, (node)) |
| #define | new_yield(node) new_yield_gen(parser, (node)) |
| #define | dsym_node(node) dsym_node_gen(parser, (node)) |
| #define | gettable(id) gettable_gen(parser,(id)) |
| #define | assignable(id, node) assignable_gen(parser, (id), (node)) |
| #define | aryset(node1, node2) aryset_gen(parser, (node1), (node2)) |
| #define | attrset(node, id) attrset_gen(parser, (node), (id)) |
| #define | rb_backref_error(n) rb_backref_error_gen(parser,(n)) |
| #define | node_assign(node1, node2) node_assign_gen(parser, (node1), (node2)) |
| #define | new_attr_op_assign(lhs, type, attr, op, rhs) new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs)) |
| #define | new_const_op_assign(lhs, op, rhs) new_const_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define | match_op(node1, node2) match_op_gen(parser, (node1), (node2)) |
| #define | local_tbl() local_tbl_gen(parser) |
| #define | reg_compile(str, options) reg_compile_gen(parser, (str), (options)) |
| #define | reg_fragment_setenc(str, options) reg_fragment_setenc_gen(parser, (str), (options)) |
| #define | reg_fragment_check(str, options) reg_fragment_check_gen(parser, (str), (options)) |
| #define | reg_named_capture_assign(regexp, match) reg_named_capture_assign_gen(parser,(regexp),(match)) |
| #define | get_id(id) (id) |
| #define | get_value(val) (val) |
| #define | new_op_assign(lhs, op, rhs) new_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define | formal_argument(id) formal_argument_gen(parser, (id)) |
| #define | shadowing_lvar(name) shadowing_lvar_gen(parser, (name)) |
| #define | new_bv(id) new_bv_gen(parser, (id)) |
| #define | local_push(top) local_push_gen(parser,(top)) |
| #define | local_pop() local_pop_gen(parser) |
| #define | local_var(id) local_var_gen(parser, (id)) |
| #define | arg_var(id) arg_var_gen(parser, (id)) |
| #define | local_id(id) local_id_gen(parser, (id)) |
| #define | internal_id() internal_id_gen(parser) |
| #define | dyna_push() dyna_push_gen(parser) |
| #define | dyna_pop(node) dyna_pop_gen(parser, (node)) |
| #define | dyna_in_block() dyna_in_block_gen(parser) |
| #define | dyna_var(id) local_var(id) |
| #define | dvar_defined(id) dvar_defined_gen(parser, (id), 0) |
| #define | dvar_defined_get(id) dvar_defined_gen(parser, (id), 1) |
| #define | dvar_curr(id) dvar_curr_gen(parser, (id)) |
| #define | lvar_defined(id) lvar_defined_gen(parser, (id)) |
| #define | RE_OPTION_ONCE (1<<16) |
| #define | RE_OPTION_ENCODING_SHIFT 8 |
| #define | RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT) |
| #define | RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff) |
| #define | RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE) |
| #define | RE_OPTION_MASK 0xff |
| #define | RE_OPTION_ARG_ENCODING_NONE 32 |
| #define | NODE_STRTERM NODE_ZARRAY /* nothing to gc */ |
| #define | NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */ |
| #define | SIGN_EXTEND(x, n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1)) |
| #define | nd_func u1.id |
| #define | nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2) |
| #define | nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2) |
| #define | nd_nest u3.cnt |
| #define | Qnone 0 |
| #define | ifndef_ripper(x) (x) |
| #define | rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define | rb_warnI(fmt, a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define | rb_warnS(fmt, a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define | rb_warn4S(file, line, fmt, a) rb_compile_warn((file), (line), (fmt), (a)) |
| #define | rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define | rb_warningS(fmt, a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define | rb_compile_error rb_compile_error_with_enc |
| #define | compile_error parser->nerr++,rb_compile_error_with_enc |
| #define | PARSER_ARG ruby_sourcefile, ruby_sourceline, current_enc, |
| #define | token_info_push(token) (RTEST(ruby_verbose) ? token_info_push(parser, (token)) : (void)0) |
| #define | token_info_pop(token) (RTEST(ruby_verbose) ? token_info_pop(parser, (token)) : (void)0) |
| #define | yylval (*((YYSTYPE*)(parser->parser_yylval))) |
| #define | nextc() parser_nextc(parser) |
| #define | pushback(c) parser_pushback(parser, (c)) |
| #define | newtok() parser_newtok(parser) |
| #define | tokspace(n) parser_tokspace(parser, (n)) |
| #define | tokadd(c) parser_tokadd(parser, (c)) |
| #define | tok_hex(numlen) parser_tok_hex(parser, (numlen)) |
| #define | read_escape(flags, e) parser_read_escape(parser, (flags), (e)) |
| #define | tokadd_escape(e) parser_tokadd_escape(parser, (e)) |
| #define | regx_options() parser_regx_options(parser) |
| #define | tokadd_string(f, t, p, n, e) parser_tokadd_string(parser,(f),(t),(p),(n),(e)) |
| #define | parse_string(n) parser_parse_string(parser,(n)) |
| #define | tokaddmbc(c, enc) parser_tokaddmbc(parser, (c), (enc)) |
| #define | here_document(n) parser_here_document(parser,(n)) |
| #define | heredoc_identifier() parser_heredoc_identifier(parser) |
| #define | heredoc_restore(n) parser_heredoc_restore(parser,(n)) |
| #define | whole_match_p(e, l, i) parser_whole_match_p(parser,(e),(l),(i)) |
| #define | set_yylval_str(x) (yylval.node = NEW_STR(x)) |
| #define | set_yylval_num(x) (yylval.num = (x)) |
| #define | set_yylval_id(x) (yylval.id = (x)) |
| #define | set_yylval_name(x) (yylval.id = (x)) |
| #define | set_yylval_literal(x) (yylval.node = NEW_LIT(x)) |
| #define | set_yylval_node(x) (yylval.node = (x)) |
| #define | yylval_id() (yylval.id) |
| #define | ripper_flush(p) (void)(p) |
| #define | SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) |
| #define | parser_encoding_name() (current_enc->name) |
| #define | parser_mbclen() mbclen((lex_p-1),lex_pend,current_enc) |
| #define | parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc) |
| #define | is_identchar(p, e, enc) (rb_enc_isalnum(*(p),(enc)) || (*(p)) == '_' || !ISASCII(*(p))) |
| #define | parser_is_identchar() (!parser->eofp && is_identchar((lex_p-1),lex_pend,current_enc)) |
| #define | parser_isascii() ISASCII(*(lex_p-1)) |
| #define | STR_FUNC_ESCAPE 0x01 |
| #define | STR_FUNC_EXPAND 0x02 |
| #define | STR_FUNC_REGEXP 0x04 |
| #define | STR_FUNC_QWORDS 0x08 |
| #define | STR_FUNC_SYMBOL 0x10 |
| #define | STR_FUNC_INDENT 0x20 |
| #define | lex_goto_eol(parser) ((parser)->parser_lex_p = (parser)->parser_lex_pend) |
| #define | lex_eol_p() (lex_p >= lex_pend) |
| #define | peek(c) peek_n((c), 0) |
| #define | peek_n(c, n) (lex_p+(n) < lex_pend && (c) == (unsigned char)lex_p[n]) |
| #define | was_bol() (lex_p == lex_pbeg + 1) |
| #define | tokfix() (tokenbuf[tokidx]='\0') |
| #define | tok() tokenbuf |
| #define | toklen() tokidx |
| #define | toklast() (tokidx>0?tokenbuf[tokidx-1]:0) |
| #define | tokcopy(n) memcpy(tokspace(n), lex_p - (n), (n)) |
| #define | ESCAPE_CONTROL 1 |
| #define | ESCAPE_META 2 |
| #define | tokadd_mbchar(c) parser_tokadd_mbchar(parser, (c)) |
| #define | mixed_error(enc1, enc2) |
| #define | mixed_escape(beg, enc1, enc2) |
| #define | NEW_STRTERM(func, term, paren) rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) |
| #define | flush_string_content(enc) ((void)(enc)) |
| #define | BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0) |
| #define | SPECIAL_PUNCT(idx) |
| #define | dispatch_heredoc_end() ((void)0) |
| #define | arg_ambiguous() (arg_ambiguous_gen(parser), 1) |
| #define | str_copy(_s, _p, _n) |
| #define | IS_ARG() IS_lex_state(EXPR_ARG_ANY) |
| #define | IS_END() IS_lex_state(EXPR_END_ANY) |
| #define | IS_BEG() IS_lex_state(EXPR_BEG_ANY) |
| #define | IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c)) |
| #define | IS_LABEL_POSSIBLE() ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG()) |
| #define | IS_LABEL_SUFFIX(n) (peek_n(':',(n)) && !peek_n(':', (n)+1)) |
| #define | IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT) |
| #define | ambiguous_operator(op, syn) |
| #define | warn_balanced(op, syn) |
| #define | no_digits() do {yyerror("numeric literal without digits"); return 0;} while (0) |
| #define | parser_warning(node, mesg) parser_warning(parser, (node), (mesg)) |
| #define | parser_warn(node, mesg) parser_warn(parser, (node), (mesg)) |
| #define | assignable_result(x) (x) |
| #define | LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1)) |
| #define | subnodes(n1, n2) |
| #define | op_tbl_count numberof(op_tbl) |
| #define | ENABLE_SELECTOR_NAMESPACE 0 |
| #define | HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE)) |
| #define | NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0) |
| #define | ADD2HEAP(n, c, p) |
Typedefs | |
| typedef VALUE | stack_type |
| typedef struct token_info | token_info |
Variables | |
| primary_value['opt_call_args rbracket{$$=aryset($1, $3);}|primary_value '.'tIDENTIFIER{$$=attrset($1, $3);}|primary_value tCOLON2 tIDENTIFIER{$$=attrset($1, $3);}|primary_value '.'tCONSTANT{$$=attrset($1, $3);}|primary_value tCOLON2 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON2($1, $3));}|tCOLON3 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON3($2));}|backref{rb_backref_error($1);$$=NEW_BEGIN(0);};lhs:user_variable{$$=assignable($1, 0);if(!$$)$$=NEW_BEGIN(0);}|keyword_variable{$$=assignable($1, 0);if(!$$)$$=NEW_BEGIN(0);}|primary_value '['opt_call_args rbracket{$$=aryset($1, $3);}|primary_value '.'tIDENTIFIER{$$=attrset($1, $3);}|primary_value tCOLON2 tIDENTIFIER{$$=attrset($1, $3);}|primary_value '.'tCONSTANT{$$=attrset($1, $3);}|primary_value tCOLON2 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON2($1, $3));}|tCOLON3 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON3($2));}|backref{rb_backref_error($1);$$=NEW_BEGIN(0);};cname:tIDENTIFIER{yyerror("class/module name must be CONSTANT");}|tCONSTANT;cpath:tCOLON3 cname{$$=NEW_COLON3($2);}|cname{$$=NEW_COLON2(0,$$);}|primary_value tCOLON2 cname{$$=NEW_COLON2($1, $3);};fname:tIDENTIFIER|tCONSTANT|tFID|op{lex_state=EXPR_ENDFN;$$=$1;}|reswords{lex_state=EXPR_ENDFN;$$=$ < id >1;};fsym:fname|symbol;fitem:fsym{$$=NEW_LIT(ID2SYM($1));}|dsym;undef_list:fitem{$$=NEW_UNDEF($1);}|undef_list ','{lex_state=EXPR_FNAME;}fitem{$$=block_append($1, NEW_UNDEF($4));};op: '|'{ifndef_ripper($$= '|');}| '^'{ifndef_ripper($$= '^');}| '&'{ifndef_ripper($$= '&');}|tCMP{ifndef_ripper($$=tCMP);}|tEQ{ifndef_ripper($$=tEQ);}|tEQQ{ifndef_ripper($$=tEQQ);}|tMATCH{ifndef_ripper($$=tMATCH);}|tNMATCH{ifndef_ripper($$=tNMATCH);}| '> '{ifndef_ripper($$= '> ');}|tGEQ{ifndef_ripper($$=tGEQ);}| ' <'{ifndef_ripper($$= ' <');}|tLEQ{ifndef_ripper($$=tLEQ);}|tNEQ{ifndef_ripper($$=tNEQ);}|tLSHFT{ifndef_ripper($$=tLSHFT);}|tRSHFT{ifndef_ripper($$=tRSHFT);}| '+'{ifndef_ripper($$= '+');}| '-'{ifndef_ripper($$= '-');}| '*'{ifndef_ripper($$= '*');}|tSTAR{ifndef_ripper($$= '*');}| '/'{ifndef_ripper($$= '/');}| '%'{ifndef_ripper($$= '%');}|tPOW{ifndef_ripper($$=tPOW);}|tDSTAR{ifndef_ripper($$=tDSTAR);}| '!'{ifndef_ripper($$= '!');}| '~'{ifndef_ripper($$= '~');}|tUPLUS{ifndef_ripper($$=tUPLUS);}|tUMINUS{ifndef_ripper($$=tUMINUS);}|tAREF{ifndef_ripper($$=tAREF);}|tASET{ifndef_ripper($$=tASET);}| '`'{ifndef_ripper($$= '`');};reswords:keyword__LINE__|keyword__FILE__|keyword__ENCODING__|keyword_BEGIN|keyword_END|keyword_alias|keyword_and|keyword_begin|keyword_break|keyword_case|keyword_class|keyword_def|keyword_defined|keyword_do|keyword_else|keyword_elsif|keyword_end|keyword_ensure|keyword_false|keyword_for|keyword_in|keyword_module|keyword_next|keyword_nil|keyword_not|keyword_or|keyword_redo|keyword_rescue|keyword_retry|keyword_return|keyword_self|keyword_super|keyword_then|keyword_true|keyword_undef|keyword_when|keyword_yield|keyword_if|keyword_unless|keyword_while|keyword_until;arg:lhs '='arg{value_expr($3);$$=node_assign($1, $3);}|lhs '='arg modifier_rescue arg{value_expr($3);$3=NEW_RESCUE($3, NEW_RESBODY(0, $5, 0), 0);$$=node_assign($1, $3);}|var_lhs tOP_ASGN arg{value_expr($3);$$=new_op_assign($1, $2, $3);}|var_lhs tOP_ASGN arg modifier_rescue arg{value_expr($3);$3=NEW_RESCUE($3, NEW_RESBODY(0, $5, 0), 0);$$=new_op_assign($1, $2, $3);}|primary_value '['opt_call_args rbracket tOP_ASGN arg{NODE *args;value_expr($6);if(!$3) $3=NEW_ZARRAY();if(nd_type($3)==NODE_BLOCK_PASS){args=NEW_ARGSCAT($3, $6);}else{args=arg_concat($3, $6);}if($5==tOROP){$5=0;}else if($5==tANDOP){$5=1;}$$=NEW_OP_ASGN1($1, $5, args);fixpos($$, $1);}|primary_value '.'tIDENTIFIER tOP_ASGN arg{value_expr($5);$$=new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);}|primary_value '.'tCONSTANT tOP_ASGN arg{value_expr($5);$$=new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);}|primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg{value_expr($5);$$=new_attr_op_assign($1, ripper_intern("::"), $3, $4, $5);}|primary_value tCOLON2 tCONSTANT tOP_ASGN arg{$$=NEW_COLON2($1, $3);$$=new_const_op_assign($$, $4, $5);}|tCOLON3 tCONSTANT tOP_ASGN arg{$$=NEW_COLON3($2);$$=new_const_op_assign($$, $3, $4);}|backref tOP_ASGN arg{rb_backref_error($1);$$=NEW_BEGIN(0);}|arg tDOT2 arg{value_expr($1);value_expr($3);$$=NEW_DOT2($1, $3);if(nd_type($1)==NODE_LIT &&FIXNUM_P($1->nd_lit)&&nd_type($3)==NODE_LIT &&FIXNUM_P($3->nd_lit)){deferred_nodes=list_append(deferred_nodes,$$);}}|arg tDOT3 arg{value_expr($1);value_expr($3);$$=NEW_DOT3($1, $3);if(nd_type($1)==NODE_LIT &&FIXNUM_P($1->nd_lit)&&nd_type($3)==NODE_LIT &&FIXNUM_P($3->nd_lit)){deferred_nodes=list_append(deferred_nodes,$$);}}|arg '+'arg{$$=call_bin_op($1, '+', $3);}|arg '-'arg{$$=call_bin_op($1, '-', $3);}|arg '*'arg{$$=call_bin_op($1, '*', $3);}|arg '/'arg{$$=call_bin_op($1, '/', $3);}|arg '%'arg{$$=call_bin_op($1, '%', $3);}|arg tPOW arg{$$=call_bin_op($1, tPOW, $3);}|tUMINUS_NUM tINTEGER tPOW arg{$$=NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);}|tUMINUS_NUM tFLOAT tPOW arg{$$=NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);}|tUPLUS arg{$$=call_uni_op($2, tUPLUS);}|tUMINUS arg{$$=call_uni_op($2, tUMINUS);}|arg '|'arg{$$=call_bin_op($1, '|', $3);}|arg '^'arg{$$=call_bin_op($1, '^', $3);}|arg '&'arg{$$=call_bin_op($1, '&', $3);}|arg tCMP arg{$$=call_bin_op($1, tCMP, $3);}|arg '>'arg{$$=call_bin_op($1, '> ', $3);}|arg tGEQ arg{$$=call_bin_op($1, tGEQ, $3);}|arg '<'arg{$$=call_bin_op($1, ' <', $3);}|arg tLEQ arg{$$=call_bin_op($1, tLEQ, $3);}|arg tEQ arg{$$=call_bin_op($1, tEQ, $3);}|arg tEQQ arg{$$=call_bin_op($1, tEQQ, $3);}|arg tNEQ arg{$$=call_bin_op($1, tNEQ, $3);}|arg tMATCH arg{$$=match_op($1, $3);if(nd_type($1)==NODE_LIT &&RB_TYPE_P($1->nd_lit, T_REGEXP)){$$=reg_named_capture_assign($1-> nd_lit,$$);}}|arg tNMATCH arg{$$=call_bin_op($1, tNMATCH, $3);}| '!'arg{$$=call_uni_op(cond($2), '!');}| '~'arg{$$=call_uni_op($2, '~');}|arg tLSHFT arg{$$=call_bin_op($1, tLSHFT, $3);}|arg tRSHFT arg{$$=call_bin_op($1, tRSHFT, $3);}|arg tANDOP arg{$$=logop(NODE_AND, $1, $3);}|arg tOROP arg{$$=logop(NODE_OR, $1, $3);}|keyword_defined opt_nl{in_defined=1;}arg{in_defined=0;$$=NEW_DEFINED($4);}|arg '?'arg opt_nl ':'arg{value_expr($1);$$=NEW_IF(cond($1), $3, $6);fixpos($$, $1);}|primary{$$=$1;};arg_value:arg{value_expr($1);$$=$1;if(!$$)$$=NEW_NIL();};aref_args:none|args trailer{$$=$1;}|args ','assocs trailer{$$=arg_append($1, NEW_HASH($3));}|assocs trailer{$$=NEW_LIST(NEW_HASH($1));};paren_args: '('opt_call_args rparen{$$=$2;};opt_paren_args:none|paren_args;opt_call_args:none|call_args|args ','{$$=$1;}|args ','assocs ','{$$=arg_append($1, NEW_HASH($3));}|assocs ','{$$=NEW_LIST(NEW_HASH($1));};call_args:command{value_expr($1);$$=NEW_LIST($1);}|args opt_block_arg{$$=arg_blk_pass($1, $2);}|assocs opt_block_arg{$$=NEW_LIST(NEW_HASH($1));$$=arg_blk_pass($$, $2);}|args ','assocs opt_block_arg{$$=arg_append($1, NEW_HASH($3));$$=arg_blk_pass($$, $4);}|block_arg;command_args:{$ < val > $=cmdarg_stack;CMDARG_PUSH(1);}call_args{cmdarg_stack=$ < val > 1;$$=$2;};block_arg:tAMPER arg_value{$$=NEW_BLOCK_PASS($2);};opt_block_arg: ','block_arg{$$=$2;}|none{$$=0;};args:arg_value{$$=NEW_LIST($1);}|tSTAR arg_value{$$=NEW_SPLAT($2);}|args ','arg_value{NODE *n1;if((n1=splat_array($1))!=0){$$=list_append(n1, $3);}else{$$=arg_append($1, $3);}}|args ','tSTAR arg_value{NODE *n1;if((nd_type($4)==NODE_ARRAY)&&(n1=splat_array($1))!=0){$$=list_concat(n1, $4);}else{$$=arg_concat($1, $4);}};mrhs:args ','arg_value{NODE *n1;if((n1=splat_array($1))!=0){$$=list_append(n1, $3);}else{$$=arg_append($1, $3);}}|args ','tSTAR arg_value{NODE *n1;if(nd_type($4)==NODE_ARRAY &&(n1=splat_array($1))!=0){$$=list_concat(n1, $4);}else{$$=arg_concat($1, $4);}}|tSTAR arg_value{$$=NEW_SPLAT($2);};primary:literal|strings|xstring|regexp|words|qwords|symbols|qsymbols|var_ref|backref|tFID{$$=NEW_FCALL($1, 0);}|k_begin{$< val > 1=cmdarg_stack;cmdarg_stack=0;$ < num > $=ruby_sourceline;}bodystmt k_end{cmdarg_stack=$< val > 1;if($3==NULL){$$=NEW_NIL();}else{if(nd_type($3)==NODE_RESCUE||nd_type($3)==NODE_ENSURE) nd_set_line($3,$< num > 2);$$=NEW_BEGIN($3);}nd_set_line($$,$ < num >2);}|tLPAREN_ARG{lex_state=EXPR_ENDARG;}rparen{$$=0;}|tLPAREN_ARG expr{lex_state=EXPR_ENDARG;}rparen{$$=$2;}|tLPAREN compstmt ')'{$$=$2;}|primary_value tCOLON2 tCONSTANT{$$=NEW_COLON2($1, $3);}|tCOLON3 tCONSTANT{$$=NEW_COLON3($2);}|tLBRACK aref_args ']'{if($2==0){$$=NEW_ZARRAY();}else{$$=$2;}}|tLBRACE assoc_list '}'{$$=NEW_HASH($2);}|keyword_return{$$=NEW_RETURN(0);}|keyword_yield '('call_args rparen{$$=new_yield($3);}|keyword_yield '('rparen{$$=NEW_YIELD(0);}|keyword_yield{$$=NEW_YIELD(0);}|keyword_defined opt_nl '('{in_defined=1;}expr rparen{in_defined=0;$$=NEW_DEFINED($5);}|keyword_not '('expr rparen{$$=call_uni_op(cond($3), '!');}|keyword_not '('rparen{$$=call_uni_op(cond(NEW_NIL()), '!');}|fcall brace_block{$2-> nd_iter=$1;$$=$2;}|method_call|method_call brace_block{block_dup_check($1-> nd_args, $2);$2->nd_iter=$1;$$=$2;}|tLAMBDA lambda{$$=$2;}|k_if expr_value then compstmt if_tail k_end{$$=NEW_IF(cond($2), $4, $5);fixpos($$, $2);}|k_unless expr_value then compstmt opt_else k_end{$$=NEW_UNLESS(cond($2), $4, $5);fixpos($$, $2);}|k_while{COND_PUSH(1);}expr_value do{COND_POP();}compstmt k_end{$$=NEW_WHILE(cond($3), $6, 1);fixpos($$, $3);}|k_until{COND_PUSH(1);}expr_value do{COND_POP();}compstmt k_end{$$=NEW_UNTIL(cond($3), $6, 1);fixpos($$, $3);}|k_case expr_value opt_terms case_body k_end{$$=NEW_CASE($2, $4);fixpos($$, $2);}|k_case opt_terms case_body k_end{$$=NEW_CASE(0, $3);}|k_for for_var keyword_in{COND_PUSH(1);}expr_value do{COND_POP();}compstmt k_end{ID id=internal_id();ID *tbl=ALLOC_N(ID, 2);NODE *m=NEW_ARGS_AUX(0, 0);NODE *args,*scope;if(nd_type($2)==NODE_MASGN){NODE *one=NEW_LIST(NEW_LIT(INT2FIX(1)));NODE *zero=NEW_LIST(NEW_LIT(INT2FIX(0)));m-> nd_next=block_append(NEW_IF(NEW_NODE(NODE_AND, NEW_CALL(NEW_CALL(NEW_DVAR(id), idLength, 0), idEq, one), NEW_CALL(NEW_CALL(NEW_DVAR(id), idAREF, zero), rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))), 0), NEW_DASGN_CURR(id, NEW_CALL(NEW_DVAR(id), idAREF, zero)), 0), node_assign($2, NEW_DVAR(id)));args=new_args(m, 0, id, 0, new_args_tail(0, 0, 0));}else{if(nd_type($2)==NODE_LASGN||nd_type($2)==NODE_DASGN||nd_type($2)==NODE_DASGN_CURR){$2-> nd_value=NEW_DVAR(id);m-> nd_plen=1;m->nd_next=$2;args=new_args(m, 0, 0, 0, new_args_tail(0, 0, 0));}else{m->nd_next=node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id));args=new_args(m, 0, id, 0, new_args_tail(0, 0, 0));}}scope=NEW_NODE(NODE_SCOPE, tbl, $8, args);tbl[0]=1;tbl[1]=id;$$=NEW_FOR(0, $5, scope);fixpos($$, $2);}|k_class cpath superclass{if(in_def||in_single) yyerror("class definition in method body");local_push(0);$ < num > $=ruby_sourceline;}bodystmt k_end{$$=NEW_CLASS($2, $5, $3);nd_set_line($$,$< num > 4);local_pop();}|k_class tLSHFT expr{$< num > $=in_def;in_def=0;}term{$ < num > $=in_single;in_single=0;local_push(0);}bodystmt k_end{$$=NEW_SCLASS($3, $7);fixpos($$, $3);local_pop();in_def=$ < num >4;in_single=$< num > 6;}|k_module cpath{if(in_def||in_single) yyerror("module definition in method body");local_push(0);$ < num > $=ruby_sourceline;}bodystmt k_end{$$=NEW_MODULE($2, $4);nd_set_line($$,$< num > 3);local_pop();}|k_def fname{$ < id > $=cur_mid;cur_mid=$2;in_def++;local_push(0);}f_arglist bodystmt k_end{NODE *body=remove_begin($5);reduce_nodes(&body);$$=NEW_DEFN($2, $4, body, NOEX_PRIVATE);nd_set_line($$,$ < num >1);local_pop();in_def--;cur_mid=$ < id >3;}|k_def singleton dot_or_colon{lex_state=EXPR_FNAME;}fname{in_single++;lex_state=EXPR_ENDFN;local_push(0);}f_arglist bodystmt k_end{NODE *body=remove_begin($8);reduce_nodes(&body);$$=NEW_DEFS($2, $5, $7, body);nd_set_line($$,$ < num >1);local_pop();in_single--;}|keyword_break{$$=NEW_BREAK(0);}|keyword_next{$$=NEW_NEXT(0);}|keyword_redo{$$=NEW_REDO();}|keyword_retry{$$=NEW_RETRY();};primary_value:primary{value_expr($1);$$=$1;if(!$$)$$=NEW_NIL();};k_begin:keyword_begin{token_info_push("begin");};k_if:keyword_if{token_info_push("if");};k_unless:keyword_unless{token_info_push("unless");};k_while:keyword_while{token_info_push("while");};k_until:keyword_until{token_info_push("until");};k_case:keyword_case{token_info_push("case");};k_for:keyword_for{token_info_push("for");};k_class:keyword_class{token_info_push("class");};k_module:keyword_module{token_info_push("module");};k_def:keyword_def{token_info_push("def");$ < num > $=ruby_sourceline;};k_end:keyword_end{token_info_pop("end");};then:term|keyword_then|term keyword_then;do:term|keyword_do_cond;if_tail:opt_else|keyword_elsif expr_value then compstmt if_tail{$$=NEW_IF(cond($2), $4, $5);fixpos($$, $2);};opt_else:none|keyword_else compstmt{$$=$2;};for_var:lhs|mlhs;f_marg:f_norm_arg{$$=assignable($1, 0);}|tLPAREN f_margs rparen{$$=$2;};f_marg_list:f_marg{$$=NEW_LIST($1);}|f_marg_list ','f_marg{$$=list_append($1, $3);};f_margs:f_marg_list{$$=NEW_MASGN($1, 0);}|f_marg_list ','tSTAR f_norm_arg{$$=assignable($4, 0);$$=NEW_MASGN($1,$$);}|f_marg_list ','tSTAR f_norm_arg ','f_marg_list{$$=assignable($4, 0);$$=NEW_MASGN($1, NEW_POSTARG($$, $6));}|f_marg_list ','tSTAR{$$=NEW_MASGN($1,-1);}|f_marg_list ','tSTAR ','f_marg_list{$$=NEW_MASGN($1, NEW_POSTARG(-1, $5));}|tSTAR f_norm_arg{$$=assignable($2, 0);$$=NEW_MASGN(0,$$);}|tSTAR f_norm_arg ','f_marg_list{$$=assignable($2, 0);$$=NEW_MASGN(0, NEW_POSTARG($$, $4));}|tSTAR{$$=NEW_MASGN(0,-1);}|tSTAR ','f_marg_list{$$=NEW_MASGN(0, NEW_POSTARG(-1, $3));};block_args_tail:f_block_kwarg ','f_kwrest opt_f_block_arg{$$=new_args_tail($1, $3, $4);}|f_block_kwarg opt_f_block_arg{$$=new_args_tail($1, Qnone, $2);}|f_kwrest opt_f_block_arg{$$=new_args_tail(Qnone, $1, $2);}|f_block_arg{$$=new_args_tail(Qnone, Qnone, $1);};opt_block_args_tail: ','block_args_tail{$$=$2;}|{$$=new_args_tail(Qnone, Qnone, Qnone);};block_param:f_arg ','f_block_optarg ','f_rest_arg opt_block_args_tail{$$=new_args($1, $3, $5, Qnone, $6);}|f_arg ','f_block_optarg ','f_rest_arg ','f_arg opt_block_args_tail{$$=new_args($1, $3, $5, $7, $8);}|f_arg ','f_block_optarg opt_block_args_tail{$$=new_args($1, $3, Qnone, Qnone, $4);}|f_arg ','f_block_optarg ','f_arg opt_block_args_tail{$$=new_args($1, $3, Qnone, $5, $6);}|f_arg ','f_rest_arg opt_block_args_tail{$$=new_args($1, Qnone, $3, Qnone, $4);}|f_arg ','{$$=new_args($1, Qnone, 1, Qnone, new_args_tail(Qnone, Qnone, Qnone));}|f_arg ','f_rest_arg ','f_arg opt_block_args_tail{$$=new_args($1, Qnone, $3, $5, $6);}|f_arg opt_block_args_tail{$$=new_args($1, Qnone, Qnone, Qnone, $2);}|f_block_optarg ','f_rest_arg opt_block_args_tail{$$=new_args(Qnone, $1, $3, Qnone, $4);}|f_block_optarg ','f_rest_arg ','f_arg opt_block_args_tail{$$=new_args(Qnone, $1, $3, $5, $6);}|f_block_optarg opt_block_args_tail{$$=new_args(Qnone, $1, Qnone, Qnone, $2);}|f_block_optarg ','f_arg opt_block_args_tail{$$=new_args(Qnone, $1, Qnone, $3, $4);}|f_rest_arg opt_block_args_tail{$$=new_args(Qnone, Qnone, $1, Qnone, $2);}|f_rest_arg ','f_arg opt_block_args_tail{$$=new_args(Qnone, Qnone, $1, $3, $4);}|block_args_tail{$$=new_args(Qnone, Qnone, Qnone, Qnone, $1);};opt_block_param:none|block_param_def{command_start=TRUE;};block_param_def: '|'opt_bv_decl '|'{$$=0;}|tOROP{$$=0;}| '|'block_param opt_bv_decl '|'{$$=$2;};opt_bv_decl:opt_nl{$$=0;}|opt_nl ';'bv_decls opt_nl{$$=0;};bv_decls:bvar|bv_decls ','bvar;bvar:tIDENTIFIER{new_bv(get_id($1));}|f_bad_arg{$$=0;};lambda:{$ < vars > $=dyna_push();}{$ < num > $=lpar_beg;lpar_beg=++paren_nest;}f_larglist lambda_body{lpar_beg=$< num > 2;$$=NEW_LAMBDA($3, $4);dyna_pop($< vars > 1);};f_larglist: '('f_args opt_bv_decl ')'{$$=$2;}|f_args{$$=$1;};lambda_body:tLAMBEG compstmt '}'{$$=$2;}|keyword_do_LAMBDA compstmt keyword_end{$$=$2;};do_block:keyword_do_block{$ < vars >1=dyna_push();$< num > $=ruby_sourceline;}opt_block_param compstmt keyword_end{$$=NEW_ITER($3, $4);nd_set_line($$,$< num > 2);dyna_pop($< vars > 1);};block_call:command do_block{if(nd_type($1)==NODE_YIELD){compile_error(PARSER_ARG"block given to yield");}else{block_dup_check($1-> nd_args, $2);}$2->nd_iter=$1;$$=$2;fixpos($$, $1);}|block_call dot_or_colon operation2 opt_paren_args{$$=NEW_CALL($1, $3, $4);}|block_call dot_or_colon operation2 opt_paren_args brace_block{block_dup_check($4, $5);$5-> nd_iter=NEW_CALL($1, $3, $4);$$=$5;fixpos($$, $1);}|block_call dot_or_colon operation2 command_args do_block{block_dup_check($4, $5);$5-> nd_iter=NEW_CALL($1, $3, $4);$$=$5;fixpos($$, $1);};method_call:fcall paren_args{$$=$1;$$->nd_args=$2;}|primary_value '.'operation2{$< num > $=ruby_sourceline;}opt_paren_args{$$=NEW_CALL($1, $3, $5);nd_set_line($$,$< num > 4);}|primary_value tCOLON2 operation2{$< num > $=ruby_sourceline;}paren_args{$$=NEW_CALL($1, $3, $5);nd_set_line($$,$< num > 4);}|primary_value tCOLON2 operation3{$$=NEW_CALL($1, $3, 0);}|primary_value '.'{$ < num > $=ruby_sourceline;}paren_args{$$=NEW_CALL($1, rb_intern("call"), $4);nd_set_line($$,$< num > 3);}|primary_value tCOLON2{$ < num > $=ruby_sourceline;}paren_args{$$=NEW_CALL($1, rb_intern("call"), $4);nd_set_line($$,$< num > 3);}|keyword_super paren_args{$$=NEW_SUPER($2);}|keyword_super{$$=NEW_ZSUPER();}|primary_value '['opt_call_args rbracket{if($1 &&nd_type($1)==NODE_SELF)$$=NEW_FCALL(tAREF, $3);else $$=NEW_CALL($1, tAREF, $3);fixpos($$, $1);};brace_block: '{'{$< vars > 1=dyna_push();$< num > $=ruby_sourceline;}opt_block_param compstmt '}'{$$=NEW_ITER($3, $4);nd_set_line($$,$< num > 2);dyna_pop($< vars > 1);}|keyword_do{$< vars > 1=dyna_push();$< num > $=ruby_sourceline;}opt_block_param compstmt keyword_end{$$=NEW_ITER($3, $4);nd_set_line($$,$< num > 2);dyna_pop($< vars > 1);};case_body:keyword_when args then compstmt cases{$$=NEW_WHEN($2, $4, $5);};cases:opt_else|case_body;opt_rescue:keyword_rescue exc_list exc_var then compstmt opt_rescue{if($3){$3=node_assign($3, NEW_ERRINFO());$5=block_append($3, $5);}$$=NEW_RESBODY($2, $5, $6);fixpos($$, $2?$2:$5);}|none;exc_list:arg_value{$$=NEW_LIST($1);}|mrhs{if(!($$=splat_array($1)))$$=$1;}|none;exc_var:tASSOC lhs{$$=$2;}|none;opt_ensure:keyword_ensure compstmt{$$=$2;}|none;literal:numeric|symbol{$$=NEW_LIT(ID2SYM($1));}|dsym;strings:string{NODE *node=$1;if(!node){node=NEW_STR(STR_NEW0());}else{node=evstr2dstr(node);}$$=node;};string:tCHAR|string1|string string1{$$=literal_concat($1, $2);};string1:tSTRING_BEG string_contents tSTRING_END{$$=$2;};xstring:tXSTRING_BEG xstring_contents tSTRING_END{NODE *node=$2;if(!node){node=NEW_XSTR(STR_NEW0());}else{switch(nd_type(node)){case NODE_STR:nd_set_type(node, NODE_XSTR);break;case NODE_DSTR:nd_set_type(node, NODE_DXSTR);break;default:node=NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node));break;}}$$=node;};regexp:tREGEXP_BEG regexp_contents tREGEXP_END{int options=$3;NODE *node=$2;NODE *list,*prev;if(!node){node=NEW_LIT(reg_compile(STR_NEW0(), options));}else switch(nd_type(node)){case NODE_STR:{VALUE src=node-> nd_lit;nd_set_type(node, NODE_LIT);node->nd_lit=reg_compile(src, options);}break;default:node=NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node));case NODE_DSTR:if(options &RE_OPTION_ONCE){nd_set_type(node, NODE_DREGX_ONCE);}else{nd_set_type(node, NODE_DREGX);}node->nd_cflag=options &RE_OPTION_MASK;if(!NIL_P(node-> nd_lit)) reg_fragment_check(node-> nd_lit, options);for(list=(prev=node) -> nd_next;list;list=list-> nd_next){if(nd_type(list-> nd_head)==NODE_STR){VALUE tail=list-> nd_head->nd_lit;if(reg_fragment_check(tail, options)&&prev &&!NIL_P(prev-> nd_lit)){VALUE lit=prev==node?prev-> nd_lit:prev->nd_head->nd_lit;if(!literal_concat0(parser, lit, tail)){node=0;break;}rb_str_resize(tail, 0);prev->nd_next=list->nd_next;rb_gc_force_recycle((VALUE) list->nd_head);rb_gc_force_recycle((VALUE) list);list=prev;}else{prev=list;}}else{prev=0;}}if(!node-> nd_next){VALUE src=node-> nd_lit;nd_set_type(node, NODE_LIT);node->nd_lit=reg_compile(src, options);}break;}$$=node;};words:tWORDS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tWORDS_BEG word_list tSTRING_END{$$=$2;};word_list:{$$=0;}|word_list word ' '{$$=list_append($1, evstr2dstr($2));};word:string_content|word string_content{$$=literal_concat($1, $2);};symbols:tSYMBOLS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tSYMBOLS_BEG symbol_list tSTRING_END{$$=$2;};symbol_list:{$$=0;}|symbol_list word ' '{$2=evstr2dstr($2);nd_set_type($2, NODE_DSYM);$$=list_append($1, $2);};qwords:tQWORDS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tQWORDS_BEG qword_list tSTRING_END{$$=$2;};qsymbols:tQSYMBOLS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tQSYMBOLS_BEG qsym_list tSTRING_END{$$=$2;};qword_list:{$$=0;}|qword_list tSTRING_CONTENT ' '{$$=list_append($1, $2);};qsym_list:{$$=0;}|qsym_list tSTRING_CONTENT ' '{VALUE lit;lit=$2-> nd_lit;$2->nd_lit=ID2SYM(rb_intern_str(lit));nd_set_type($2, NODE_LIT);$$=list_append($1, $2);};string_contents:{$$=0;}|string_contents string_content{$$=literal_concat($1, $2);};xstring_contents:{$$=0;}|xstring_contents string_content{$$=literal_concat($1, $2);};regexp_contents:{$$=0;}|regexp_contents string_content{NODE *head=$1,*tail=$2;if(!head){$$=tail;}else if(!tail){$$=head;}else{switch(nd_type(head)){case NODE_STR:nd_set_type(head, NODE_DSTR);break;case NODE_DSTR:break;default:head=list_append(NEW_DSTR(Qnil), head);break;}$$=list_append(head, tail);}};string_content:tSTRING_CONTENT|tSTRING_DVAR{$ < node > $=lex_strterm;lex_strterm=0;lex_state=EXPR_BEG;}string_dvar{lex_strterm=$ < node >2;$$=NEW_EVSTR($3);}|tSTRING_DBEG{$ < val >1=cond_stack;$< val > $=cmdarg_stack;cond_stack=0;cmdarg_stack=0;}{$ < node > $=lex_strterm;lex_strterm=0;lex_state=EXPR_BEG;}{$ < num > $=brace_nest;brace_nest=0;}compstmt tSTRING_DEND{cond_stack=$< val > 1;cmdarg_stack=$< val > 2;lex_strterm=$< node > 3;brace_nest=$< num >4;if($5) $5-> flags &=~NODE_FL_NEWLINE;$$=new_evstr($5);};string_dvar:tGVAR{$$=NEW_GVAR($1);}|tIVAR{$$=NEW_IVAR($1);}|tCVAR{$$=NEW_CVAR($1);}|backref;symbol:tSYMBEG sym{lex_state=EXPR_END;$$=$2;};sym:fname|tIVAR|tGVAR|tCVAR;dsym:tSYMBEG xstring_contents tSTRING_END{lex_state=EXPR_END;$$=dsym_node($2);};numeric:tINTEGER|tFLOAT|tUMINUS_NUM tINTEGER%prec tLOWEST{$$=negate_lit($2);}|tUMINUS_NUM tFLOAT%prec tLOWEST{$$=negate_lit($2);};user_variable:tIDENTIFIER|tIVAR|tGVAR|tCONSTANT|tCVAR;keyword_variable:keyword_nil{ifndef_ripper($$=keyword_nil);}|keyword_self{ifndef_ripper($$=keyword_self);}|keyword_true{ifndef_ripper($$=keyword_true);}|keyword_false{ifndef_ripper($$=keyword_false);}|keyword__FILE__{ifndef_ripper($$=keyword__FILE__);}|keyword__LINE__{ifndef_ripper($$=keyword__LINE__);}|keyword__ENCODING__{ifndef_ripper($$=keyword__ENCODING__);};var_ref:user_variable{if(!($$=gettable($1)))$$=NEW_BEGIN(0);}|keyword_variable{if(!($$=gettable($1)))$$=NEW_BEGIN(0);};var_lhs:user_variable{$$=assignable($1, 0);}|keyword_variable{$$=assignable($1, 0);};backref:tNTH_REF|tBACK_REF;superclass:term{$$=0;}| ' <'{lex_state=EXPR_BEG;command_start=TRUE;}expr_value term{$$=$3;}|error term{yyerrok;$$=0;};f_arglist: '('f_args rparen{$$=$2;lex_state=EXPR_BEG;command_start=TRUE;}|f_args term{$$=$1;lex_state=EXPR_BEG;command_start=TRUE;};args_tail:f_kwarg ','f_kwrest opt_f_block_arg{$$=new_args_tail($1, $3, $4);}|f_kwarg opt_f_block_arg{$$=new_args_tail($1, Qnone, $2);}|f_kwrest opt_f_block_arg{$$=new_args_tail(Qnone, $1, $2);}|f_block_arg{$$=new_args_tail(Qnone, Qnone, $1);};opt_args_tail: ','args_tail{$$=$2;}|{$$=new_args_tail(Qnone, Qnone, Qnone);};f_args:f_arg ','f_optarg ','f_rest_arg opt_args_tail{$$=new_args($1, $3, $5, Qnone, $6);}|f_arg ','f_optarg ','f_rest_arg ','f_arg opt_args_tail{$$=new_args($1, $3, $5, $7, $8);}|f_arg ','f_optarg opt_args_tail{$$=new_args($1, $3, Qnone, Qnone, $4);}|f_arg ','f_optarg ','f_arg opt_args_tail{$$=new_args($1, $3, Qnone, $5, $6);}|f_arg ','f_rest_arg opt_args_tail{$$=new_args($1, Qnone, $3, Qnone, $4);}|f_arg ','f_rest_arg ','f_arg opt_args_tail{$$=new_args($1, Qnone, $3, $5, $6);}|f_arg opt_args_tail{$$=new_args($1, Qnone, Qnone, Qnone, $2);}|f_optarg ','f_rest_arg opt_args_tail{$$=new_args(Qnone, $1, $3, Qnone, $4);}|f_optarg ','f_rest_arg ','f_arg opt_args_tail{$$=new_args(Qnone, $1, $3, $5, $6);}|f_optarg opt_args_tail{$$=new_args(Qnone, $1, Qnone, Qnone, $2);}|f_optarg ','f_arg opt_args_tail{$$=new_args(Qnone, $1, Qnone, $3, $4);}|f_rest_arg opt_args_tail{$$=new_args(Qnone, Qnone, $1, Qnone, $2);}|f_rest_arg ','f_arg opt_args_tail{$$=new_args(Qnone, Qnone, $1, $3, $4);}|args_tail{$$=new_args(Qnone, Qnone, Qnone, Qnone, $1);}|{$$=new_args_tail(Qnone, Qnone, Qnone);$$=new_args(Qnone, Qnone, Qnone, Qnone,$$);};f_bad_arg:tCONSTANT{yyerror("formal argument cannot be a constant");$$=0;}|tIVAR{yyerror("formal argument cannot be an instance variable");$$=0;}|tGVAR{yyerror("formal argument cannot be a global variable");$$=0;}|tCVAR{yyerror("formal argument cannot be a class variable");$$=0;};f_norm_arg:f_bad_arg|tIDENTIFIER{formal_argument(get_id($1));$$=$1;};f_arg_item:f_norm_arg{arg_var(get_id($1));$$=NEW_ARGS_AUX($1, 1);}|tLPAREN f_margs rparen{ID tid=internal_id();arg_var(tid);if(dyna_in_block()){$2-> nd_value=NEW_DVAR(tid);}else{$2-> nd_value=NEW_LVAR(tid);}$$=NEW_ARGS_AUX(tid, 1);$$-> nd_next=$2;};f_arg:f_arg_item|f_arg ','f_arg_item{$$=$1;$$-> nd_plen++;$$->nd_next=block_append($$-> nd_next, $3->nd_next);rb_gc_force_recycle((VALUE)$3);};f_kw:tLABEL arg_value{arg_var(formal_argument(get_id($1)));$$=assignable($1, $2);$$=NEW_KW_ARG(0,$$);};f_block_kw:tLABEL primary_value{arg_var(formal_argument(get_id($1)));$$=assignable($1, $2);$$=NEW_KW_ARG(0,$$);};f_block_kwarg:f_block_kw{$$=$1;}|f_block_kwarg ','f_block_kw{NODE *kws=$1;while(kws-> nd_next){kws=kws->nd_next;}kws-> nd_next=$3;$$=$1;};f_kwarg:f_kw{$$=$1;}|f_kwarg ','f_kw{NODE *kws=$1;while(kws-> nd_next){kws=kws->nd_next;}kws-> nd_next=$3;$$=$1;};kwrest_mark:tPOW|tDSTAR;f_kwrest:kwrest_mark tIDENTIFIER{shadowing_lvar(get_id($2));$$=$2;}|kwrest_mark{$$=internal_id();};f_opt:tIDENTIFIER '='arg_value{arg_var(formal_argument(get_id($1)));$$=assignable($1, $3);$$=NEW_OPT_ARG(0,$$);};f_block_opt:tIDENTIFIER '='primary_value{arg_var(formal_argument(get_id($1)));$$=assignable($1, $3);$$=NEW_OPT_ARG(0,$$);};f_block_optarg:f_block_opt{$$=$1;}|f_block_optarg ','f_block_opt{NODE *opts=$1;while(opts-> nd_next){opts=opts->nd_next;}opts-> nd_next=$3;$$=$1;};f_optarg:f_opt{$$=$1;}|f_optarg ','f_opt{NODE *opts=$1;while(opts-> nd_next){opts=opts->nd_next;}opts-> nd_next=$3;$$=$1;};restarg_mark: '*'|tSTAR;f_rest_arg:restarg_mark tIDENTIFIER{if(!is_local_id($2)) yyerror("rest argument must be local variable");arg_var(shadowing_lvar(get_id($2)));$$=$2;}|restarg_mark{$$=internal_id();arg_var($$);};blkarg_mark: '&'|tAMPER;f_block_arg:blkarg_mark tIDENTIFIER{if(!is_local_id($2)) yyerror("block argument must be local variable");else if(!dyna_in_block()&&local_id($2)) yyerror("duplicated block argument name");arg_var(shadowing_lvar(get_id($2)));$$=$2;};opt_f_block_arg: ','f_block_arg{$$=$2;}|none{$$=0;};singleton:var_ref{value_expr($1);$$=$1;if(!$$)$$=NEW_NIL();}| '('{lex_state=EXPR_BEG;}expr rparen{if($3==0){yyerror("can't define singleton method for ().");}else{switch(nd_type($3)){case NODE_STR:case NODE_DSTR:case NODE_XSTR:case NODE_DXSTR:case NODE_DREGX:case NODE_LIT:case NODE_ARRAY:case NODE_ZARRAY:yyerror("can't define singleton method for literals");default:value_expr($3);break;}}$$=$3;};assoc_list:none|assocs trailer{$$=$1;};assocs:assoc|assocs ','assoc{$$=list_concat($1, $3);};assoc:arg_value tASSOC arg_value{$$=list_append(NEW_LIST($1), $3);}|tLABEL arg_value{$$=list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2);}|tDSTAR arg_value{$$=list_append(NEW_LIST(0), $2);};;operation:tIDENTIFIER|tCONSTANT|tFID;operation2:tIDENTIFIER|tCONSTANT|tFID|op;operation3:tIDENTIFIER|tFID|op;dot_or_colon: '.'|tCOLON2;opt_terms:|terms;opt_nl:| '\n';rparen:opt_nl ')';rbracket:opt_nl ']';trailer:| '\n'| ',';term: ';'{yyerrok;}| '\n';terms:term|terms ';'{yyerrok;};none:{$$=0;};%%#define yylvalstatic int parser_regx_options(struct parser_params *);static int parser_tokadd_string(struct parser_params *, int, int, int, long *, rb_encoding **);static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);static int parser_parse_string(struct parser_params *, NODE *);static int parser_here_document(struct parser_params *, NODE *);#define nextc()#define pushback(c)#define newtok()#define tokspace(n)#define tokadd(c)#define tok_hex(numlen)#define read_escape(flags, e)#define tokadd_escape(e)#define regx_options()#define tokadd_string(f, t, p, n, e)#define parse_string(n)#define tokaddmbc(c, enc)#define here_document(n)#define heredoc_identifier()#define heredoc_restore(n)#define whole_match_p(e, l, i)#define set_yylval_str(x)#define set_yylval_num(x)#define set_yylval_id(x)#define set_yylval_name(x)#define set_yylval_literal(x)#define set_yylval_node(x)#define yylval_id()#define ripper_flush(p)#define SIGN_EXTEND_CHAR(c)#define parser_encoding_name()#define parser_mbclen()#define parser_precise_mbclen()#define is_identchar(p, e, enc)#define parser_is_identchar()#define parser_isascii() static inttoken_info_get_column(struct parser_params *parser, const char *token){int column=1;const char *p,*pend=lex_p-strlen(token);for(p=lex_pbeg;p < pend;p++){if(*p== '\t'){column=(((column-1)/8)+1)*8;}column++;}return column;}static inttoken_info_has_nonspaces(struct parser_params *parser, const char *token){const char *p,*pend=lex_p-strlen(token);for(p=lex_pbeg;p < pend;p++){if(*p!= ' '&&*p!= '\t'){return 1;}}return 0;}static voidtoken_info_push(struct parser_params *parser, const char *token){token_info *ptinfo;if(!parser-> parser_token_info_enabled) return;ptinfo=ALLOC(token_info);ptinfo-> token=token;ptinfo->linenum=ruby_sourceline;ptinfo-> column=token_info_get_column(parser, token);ptinfo->nonspc=token_info_has_nonspaces(parser, token);ptinfo->next=parser-> parser_token_info;parser-> parser_token_info=ptinfo;}static voidtoken_info_pop(struct parser_params *parser, const char *token){int linenum;token_info *ptinfo=parser-> parser_token_info;if(!ptinfo) return;parser-> parser_token_info=ptinfo->next;if(token_info_get_column(parser, token)==ptinfo->column){goto finish;}linenum=ruby_sourceline;if(linenum==ptinfo-> linenum){goto finish;}if(token_info_has_nonspaces(parser, token)||ptinfo->nonspc){goto finish;}if(parser-> parser_token_info_enabled){rb_compile_warn(ruby_sourcefile, linenum,"mismatched indentations at '%s' with '%s' at %d", token, ptinfo->token, ptinfo->linenum);}finish:xfree(ptinfo);}static intparser_yyerror(struct parser_params *parser, const char *msg){const int max_line_margin=30;const char *p,*pe;char *buf;long len;int i;compile_error(PARSER_ARG"%s", msg);p=lex_p;while(lex_pbeg<=p){if(*p== '\n') break;p--;}p++;pe=lex_p;while(pe < lex_pend){if(*pe== '\n') break;pe++;}len=pe-p;if(len > 4){char *p2;const char *pre="",*post="";if(len > max_line_margin *2+10){if(lex_p-p > max_line_margin){p=rb_enc_prev_char(p, lex_p-max_line_margin, pe, rb_enc_get(lex_lastline));pre="...";}if(pe-lex_p > max_line_margin){pe=rb_enc_prev_char(lex_p, lex_p+max_line_margin, pe, rb_enc_get(lex_lastline));post="...";}len=pe-p;}buf=ALLOCA_N(char, len+2);MEMCPY(buf, p, char, len);buf[len]= '\0';rb_compile_error_append("%s%s%s", pre, buf, post);i=(int)(lex_p-p);p2=buf;pe=buf+len;while(p2 < pe){if(*p2!= '\t')*p2= ' ';p2++;}buf[i]= '^';buf[i+1]= '\0';rb_compile_error_append("%s%s", pre, buf);}return 0;}static void parser_prepare(struct parser_params *parser);static VALUEdebug_lines(const char *f){ID script_lines;CONST_ID(script_lines,"SCRIPT_LINES__");if(rb_const_defined_at(rb_cObject, script_lines)){VALUE hash=rb_const_get_at(rb_cObject, script_lines);if(RB_TYPE_P(hash, T_HASH)){VALUE fname=rb_external_str_new_with_enc(f, strlen(f), rb_filesystem_encoding());VALUE lines=rb_ary_new();rb_hash_aset(hash, fname, lines);return lines;}}return 0;}static VALUEcoverage(const char *f, int n){VALUE coverages=rb_get_coverages();if(RTEST(coverages)&&RBASIC(coverages) -> klass==0){VALUE fname=rb_external_str_new_with_enc(f, strlen(f), rb_filesystem_encoding());VALUE lines=rb_ary_new2(n);int i;RBASIC(lines) -> klass=0;for(i=0;i< n;i++) RARRAY_PTR(lines)[i]=Qnil;RARRAY(lines) -> as.heap.len=n;rb_hash_aset(coverages, fname, lines);return lines;}return 0;}static inte_option_supplied(struct parser_params *parser){return strcmp(ruby_sourcefile,"-e")==0;}static VALUEyycompile0(VALUE arg){int n;NODE *tree;struct parser_params *parser=(struct parser_params *) arg;if(!compile_for_eval &&rb_safe_level()==0){ruby_debug_lines=debug_lines(ruby_sourcefile);if(ruby_debug_lines &&ruby_sourceline > 0){VALUE str=STR_NEW0();n=ruby_sourceline;do{rb_ary_push(ruby_debug_lines, str);}while(--n);}if(!e_option_supplied(parser)){ruby_coverage=coverage(ruby_sourcefile, ruby_sourceline);}}parser_prepare(parser);deferred_nodes=0;parser-> parser_token_info_enabled=!compile_for_eval &&RTEST(ruby_verbose);if(RUBY_DTRACE_PARSE_BEGIN_ENABLED()){RUBY_DTRACE_PARSE_BEGIN(parser-> parser_ruby_sourcefile, parser-> parser_ruby_sourceline);}n=yyparse((void *) parser);if(RUBY_DTRACE_PARSE_END_ENABLED()){RUBY_DTRACE_PARSE_END(parser-> parser_ruby_sourcefile, parser-> parser_ruby_sourceline);}ruby_debug_lines=0;ruby_coverage=0;compile_for_eval=0;lex_strterm=0;lex_p=lex_pbeg=lex_pend=0;lex_lastline=lex_nextline=0;if(parser-> nerr){return 0;}tree=ruby_eval_tree;if(!tree){tree=NEW_NIL();}else if(ruby_eval_tree_begin){tree-> nd_body=NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body);}return(VALUE) tree;}static NODE *yycompile(struct parser_params *parser, const char *f, int line){ruby_sourcefile=ruby_strdup(f);ruby_sourceline=line-1;return(NODE *) rb_suppress_tracing(yycompile0,(VALUE) parser);}static rb_encoding *must_be_ascii_compatible(VALUE s){rb_encoding *enc=rb_enc_get(s);if(!rb_enc_asciicompat(enc)){rb_raise(rb_eArgError,"invalid source encoding");}return enc;}static VALUElex_get_str(struct parser_params *parser, VALUE s){char *beg,*end,*pend;rb_encoding *enc=must_be_ascii_compatible(s);beg=RSTRING_PTR(s);if(lex_gets_ptr){if(RSTRING_LEN(s)==lex_gets_ptr) return Qnil;beg+=lex_gets_ptr;}pend=RSTRING_PTR(s)+RSTRING_LEN(s);end=beg;while(end < pend){if(*end++== '\n') break;}lex_gets_ptr=end-RSTRING_PTR(s);return rb_enc_str_new(beg, end-beg, enc);}static VALUElex_getline(struct parser_params *parser){VALUE line=(*parser->parser_lex_gets)(parser, parser->parser_lex_input);if(NIL_P(line)) return line;must_be_ascii_compatible(line);if(ruby_debug_lines){rb_enc_associate(line, current_enc);rb_ary_push(ruby_debug_lines, line);}if(ruby_coverage){rb_ary_push(ruby_coverage, Qnil);}return line;}static const rb_data_type_t parser_data_type;static NODE *parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line){struct parser_params *parser;NODE *node;TypedData_Get_Struct(vparser, struct parser_params,&parser_data_type, parser);lex_gets=lex_get_str;lex_gets_ptr=0;lex_input=s;lex_pbeg=lex_p=lex_pend=0;compile_for_eval=rb_parse_in_eval();node=yycompile(parser, f, line);RB_GC_GUARD(vparser);return node;}NODE *rb_compile_string(const char *f, VALUE s, int line){must_be_ascii_compatible(s);return parser_compile_string(rb_parser_new(), f, s, line);}NODE *rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line){must_be_ascii_compatible(s);return parser_compile_string(vparser, f, s, line);}NODE *rb_compile_cstr(const char *f, const char *s, int len, int line){VALUE str=rb_str_new(s, len);return parser_compile_string(rb_parser_new(), f, str, line);}NODE *rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line){VALUE str=rb_str_new(s, len);return parser_compile_string(vparser, f, str, line);}static VALUElex_io_gets(struct parser_params *parser, VALUE io){return rb_io_gets(io);}NODE *rb_compile_file(const char *f, VALUE file, int start){VALUE volatile vparser=rb_parser_new();return rb_parser_compile_file(vparser, f, file, start);}NODE *rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start){struct parser_params *parser;NODE *node;TypedData_Get_Struct(vparser, struct parser_params,&parser_data_type, parser);lex_gets=lex_io_gets;lex_input=file;lex_pbeg=lex_p=lex_pend=0;compile_for_eval=rb_parse_in_eval();node=yycompile(parser, f, start);RB_GC_GUARD(vparser);return node;}#define STR_FUNC_ESCAPE#define STR_FUNC_EXPAND#define STR_FUNC_REGEXP#define STR_FUNC_QWORDS#define STR_FUNC_SYMBOL#define STR_FUNC_INDENTenum string_type{str_squote=(0), str_dquote=(STR_FUNC_EXPAND), str_xquote=(STR_FUNC_EXPAND), str_regexp=(STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword=(STR_FUNC_QWORDS), str_dword=(STR_FUNC_QWORDS|STR_FUNC_EXPAND), str_ssym=(STR_FUNC_SYMBOL), str_dsym=(STR_FUNC_SYMBOL|STR_FUNC_EXPAND)};static VALUEparser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0){VALUE str;str=rb_enc_str_new(p, n, enc);if(!(func &STR_FUNC_REGEXP)&&rb_enc_asciicompat(enc)){if(rb_enc_str_coderange(str)==ENC_CODERANGE_7BIT){}else if(enc0==rb_usascii_encoding()&&enc!=rb_utf8_encoding()){rb_enc_associate(str, rb_ascii8bit_encoding());}}return str;}#define lex_goto_eol(parser)#define lex_eol_p()#define peek(c)#define peek_n(c, n) static inline intparser_nextc(struct parser_params *parser){int c;if(lex_p==lex_pend){VALUE v=lex_nextline;lex_nextline=0;if(!v){if(parser-> eofp) return-1;if(!lex_input||NIL_P(v=lex_getline(parser))){parser-> eofp=Qtrue;lex_goto_eol(parser);return-1;}}{if(heredoc_end > 0){ruby_sourceline=heredoc_end;heredoc_end=0;}ruby_sourceline++;parser-> line_count++;lex_pbeg=lex_p=RSTRING_PTR(v);lex_pend=lex_p+RSTRING_LEN(v);ripper_flush(parser);lex_lastline=v;}}c=(unsigned char)*lex_p++;if(c== '\r'&&peek('\n')){lex_p++;c= '\n';}return c;}static voidparser_pushback(struct parser_params *parser, int c){if(c==-1) return;lex_p--;if(lex_p > lex_pbeg &&lex_p[0]== '\n'&&lex_p[-1]== '\r'){lex_p--;}}#define was_bol()#define tokfix()#define tok()#define toklen()#define toklast() static char *parser_newtok(struct parser_params *parser){tokidx=0;tokline=ruby_sourceline;if(!tokenbuf){toksiz=60;tokenbuf=ALLOC_N(char, 60);}if(toksiz > 4096){toksiz=60;REALLOC_N(tokenbuf, char, 60);}return tokenbuf;}static char *parser_tokspace(struct parser_params *parser, int n){tokidx+=n;if(tokidx > =toksiz){do{toksiz *=2;}while(toksiz < tokidx);REALLOC_N(tokenbuf, char, toksiz);}return &tokenbuf[tokidx-n];}static voidparser_tokadd(struct parser_params *parser, int c){tokenbuf[tokidx++]=(char) c;if(tokidx >=toksiz){toksiz *=2;REALLOC_N(tokenbuf, char, toksiz);}}static intparser_tok_hex(struct parser_params *parser, size_t *numlen){int c;c=scan_hex(lex_p, 2, numlen);if(!*numlen){yyerror("invalid hex escape");return 0;}lex_p+=*numlen;return c;}#define tokcopy(n) static intparser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, int string_literal, int symbol_literal, int regexp_literal){int codepoint;size_t numlen;if(regexp_literal){tokadd('\\');tokadd('u');}if(peek('{')){do{if(regexp_literal){tokadd(*lex_p);}nextc();codepoint=scan_hex(lex_p, 6,&numlen);if(numlen==0){yyerror("invalid Unicode escape");return 0;}if(codepoint > 0x10ffff){yyerror("invalid Unicode codepoint (too large)");return 0;}lex_p+=numlen;if(regexp_literal){tokcopy((int) numlen);}else if(codepoint >=0x80){*encp=rb_utf8_encoding();if(string_literal) tokaddmbc(codepoint,*encp);}else if(string_literal){tokadd(codepoint);}}while(string_literal &&(peek(' ')||peek('\t')));if(!peek('}')){yyerror("unterminated Unicode escape");return 0;}if(regexp_literal){tokadd('}');}nextc();}else{codepoint=scan_hex(lex_p, 4,&numlen);if(numlen< 4){yyerror("invalid Unicode escape");return 0;}lex_p+=4;if(regexp_literal){tokcopy(4);}else if(codepoint >=0x80){*encp=rb_utf8_encoding();if(string_literal) tokaddmbc(codepoint,*encp);}else if(string_literal){tokadd(codepoint);}}return codepoint;}#define ESCAPE_CONTROL#define ESCAPE_METAstatic intparser_read_escape(struct parser_params *parser, int flags, rb_encoding **encp){int c;size_t numlen;switch(c=nextc()){case '\\':return c;case 'n':return '\n';case 't':return '\t';case 'r':return '\r';case 'f':return '\f';case 'v':return '\13';case 'a':return '\007';case 'e':return 033;case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':pushback(c);c=scan_oct(lex_p, 3,&numlen);lex_p+=numlen;return c;case 'x':c=tok_hex(&numlen);if(numlen==0) return 0;return c;case 'b':return '\010';case 's':return ' ';case 'M':if(flags &ESCAPE_META) goto eof;if((c=nextc())!= '-'){pushback(c);goto eof;}if((c=nextc())== '\\'){if(peek('u')) goto eof;return read_escape(flags|ESCAPE_META, encp)|0x80;}else if(c==-1||!ISASCII(c)) goto eof;else{return((c &0xff)|0x80);}case 'C':if((c=nextc())!= '-'){pushback(c);goto eof;}case 'c':if(flags &ESCAPE_CONTROL) goto eof;if((c=nextc())== '\\'){if(peek('u')) goto eof;c=read_escape(flags|ESCAPE_CONTROL, encp);}else if(c== '?') return 0177;else if(c==-1||!ISASCII(c)) goto eof;return c &0x9f;eof:case-1:yyerror("Invalid escape character syntax");return '\0';default:return c;}}static voidparser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc){int len=rb_enc_codelen(c, enc);rb_enc_mbcput(c, tokspace(len), enc);}static intparser_tokadd_escape(struct parser_params *parser, rb_encoding **encp){int c;int flags=0;size_t numlen;first:switch(c=nextc()){case '\n':return 0;case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':{ruby_scan_oct(--lex_p, 3,&numlen);if(numlen==0) goto eof;lex_p+=numlen;tokcopy((int) numlen+1);}return 0;case 'x':{tok_hex(&numlen);if(numlen==0) return-1;tokcopy((int) numlen+2);}return 0;case 'M':if(flags &ESCAPE_META) goto eof;if((c=nextc())!= '-'){pushback(c);goto eof;}tokcopy(3);flags|=ESCAPE_META;goto escaped;case 'C':if(flags &ESCAPE_CONTROL) goto eof;if((c=nextc())!= '-'){pushback(c);goto eof;}tokcopy(3);goto escaped;case 'c':if(flags &ESCAPE_CONTROL) goto eof;tokcopy(2);flags|=ESCAPE_CONTROL;escaped:if((c=nextc())== '\\'){goto first;}else if(c==-1) goto eof;tokadd(c);return 0;eof:case-1:yyerror("Invalid escape character syntax");return-1;default:tokadd('\\');tokadd(c);}return 0;}static intparser_regx_options(struct parser_params *parser){int kcode=0;int kopt=0;int options=0;int c, opt, kc;newtok();while(c=nextc(), ISALPHA(c)){if(c== 'o'){options|=RE_OPTION_ONCE;}else if(rb_char_to_option_kcode(c,&opt,&kc)){if(kc >=0){if(kc!=rb_ascii8bit_encindex()) kcode=c;kopt=opt;}else{options|=opt;}}else{tokadd(c);}}options|=kopt;pushback(c);if(toklen()){tokfix();compile_error(PARSER_ARG"unknown regexp option%s - %s", toklen() > 1?"s":"", tok());}return options|RE_OPTION_ENCODING(kcode);}static voiddispose_string(VALUE str){rb_str_free(str);rb_gc_force_recycle(str);}static intparser_tokadd_mbchar(struct parser_params *parser, int c){int len=parser_precise_mbclen();if(!MBCLEN_CHARFOUND_P(len)){compile_error(PARSER_ARG"invalid multibyte char (%s)", parser_encoding_name());return-1;}tokadd(c);lex_p+=--len;if(len > 0) tokcopy(len);return c;}#define tokadd_mbchar(c) static inline intsimple_re_meta(int c){switch(c){case '$':case '*':case '+':case '.':case '?':case '^':case '|':case ')':case ']':case '}':case '>':return TRUE;default:return FALSE;}}static intparser_tokadd_string(struct parser_params *parser, int func, int term, int paren, long *nest, rb_encoding **encp){int c;int has_nonascii=0;rb_encoding *enc=*encp;char *errbuf=0;static const char mixed_msg[]="%s mixed within %s source";#define mixed_error(enc1, enc2)#define mixed_escape(beg, enc1, enc2) while((c=nextc())!=-1){if(paren &&c==paren){++*nest;}else if(c==term){if(!nest||!*nest){pushback(c);break;}--*nest;}else if((func &STR_FUNC_EXPAND)&&c== '#'&&lex_p< lex_pend){int c2=*lex_p;if(c2== '$'||c2== '@'||c2== '{'){pushback(c);break;}}else if(c== '\\'){const char *beg=lex_p-1;c=nextc();switch(c){case '\n':if(func &STR_FUNC_QWORDS) break;if(func &STR_FUNC_EXPAND) continue;tokadd('\\');break;case '\\':if(func &STR_FUNC_ESCAPE) tokadd(c);break;case 'u':if((func &STR_FUNC_EXPAND)==0){tokadd('\\');break;}parser_tokadd_utf8(parser,&enc, 1, func &STR_FUNC_SYMBOL, func &STR_FUNC_REGEXP);if(has_nonascii &&enc!=*encp){mixed_escape(beg, enc,*encp);}continue;default:if(c==-1) return-1;if(!ISASCII(c)){if((func &STR_FUNC_EXPAND)==0) tokadd('\\');goto non_ascii;}if(func &STR_FUNC_REGEXP){if(c==term &&!simple_re_meta(c)){tokadd(c);continue;}pushback(c);if((c=tokadd_escape(&enc))< 0) return-1;if(has_nonascii &&enc!=*encp){mixed_escape(beg, enc,*encp);}continue;}else if(func &STR_FUNC_EXPAND){pushback(c);if(func &STR_FUNC_ESCAPE) tokadd('\\');c=read_escape(0,&enc);}else if((func &STR_FUNC_QWORDS)&&ISSPACE(c)){}else if(c!=term &&!(paren &&c==paren)){tokadd('\\');pushback(c);continue;}}}else if(!parser_isascii()){non_ascii:has_nonascii=1;if(enc!=*encp){mixed_error(enc,*encp);continue;}if(tokadd_mbchar(c)==-1) return-1;continue;}else if((func &STR_FUNC_QWORDS)&&ISSPACE(c)){pushback(c);break;}if(c &0x80){has_nonascii=1;if(enc!=*encp){mixed_error(enc,*encp);continue;}}tokadd(c);}*encp=enc;return c;}#define NEW_STRTERM(func, term, paren)#define flush_string_content(enc) RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e-0x20+31)/32];#define BIT(c, idx)#define SPECIAL_PUNCT(idx) const unsigned int ruby_global_name_punct_bits[]={SPECIAL_PUNCT(0), SPECIAL_PUNCT(1), SPECIAL_PUNCT(2),};static inline intis_global_name_punct(const char c){if(c<=0x20||0x7e< c) return 0;return(ruby_global_name_punct_bits[(c-0x20)/32] >>(c%32))&1;}static intparser_peek_variable_name(struct parser_params *parser){int c;const char *p=lex_p;if(p+1 >=lex_pend) return 0;c=*p++;switch(c){case '$':if((c=*p)== '-'){if(++p >=lex_pend) return 0;c=*p;}else if(is_global_name_punct(c)||ISDIGIT(c)){return tSTRING_DVAR;}break;case '@':if((c=*p)== '@'){if(++p >=lex_pend) return 0;c=*p;}break;case '{':lex_p=p;command_start=TRUE;return tSTRING_DBEG;default:return 0;}if(!ISASCII(c)||c== '_'||ISALPHA(c)) return tSTRING_DVAR;return 0;}static intparser_parse_string(struct parser_params *parser, NODE *quote){int func=(int) quote->nd_func;int term=nd_term(quote);int paren=nd_paren(quote);int c, space=0;rb_encoding *enc=current_enc;if(func==-1) return tSTRING_END;c=nextc();if((func &STR_FUNC_QWORDS)&&ISSPACE(c)){do{c=nextc();}while(ISSPACE(c));space=1;}if(c==term &&!quote->nd_nest){if(func &STR_FUNC_QWORDS){quote->nd_func=-1;return ' ';}if(!(func &STR_FUNC_REGEXP)) return tSTRING_END;set_yylval_num(regx_options());return tREGEXP_END;}if(space){pushback(c);return ' ';}newtok();if((func &STR_FUNC_EXPAND)&&c== '#'){int t=parser_peek_variable_name(parser);if(t) return t;tokadd('#');c=nextc();}pushback(c);if(tokadd_string(func, term, paren,"e->nd_nest,&enc)==-1){ruby_sourceline=nd_line(quote);if(func &STR_FUNC_REGEXP){if(parser->eofp) compile_error(PARSER_ARG"unterminated regexp meets end of file");return tREGEXP_END;}else{if(parser->eofp) compile_error(PARSER_ARG"unterminated string meets end of file");return tSTRING_END;}}tokfix();set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));flush_string_content(enc);return tSTRING_CONTENT;}static intparser_heredoc_identifier(struct parser_params *parser){int c=nextc(), term, func=0;long len;if(c== '-'){c=nextc();func=STR_FUNC_INDENT;}switch(c){case '\'':func|=str_squote;goto quoted;case '"': func |= str_dquote; goto quoted; case '`': func |= str_xquote; quoted: newtok(); tokadd(func); term = c; while ((c = nextc()) != -1 && c != term) { if (tokadd_mbchar(c) == -1) return 0; } if (c == -1) { compile_error(PARSER_ARG "unterminated here document identifier"); return 0; } break; default: if (!parser_is_identchar()) { pushback(c); if (func & STR_FUNC_INDENT) { pushback('-'); } return 0; } newtok(); term = '"';tokadd(func|=str_dquote);do{if(tokadd_mbchar(c)==-1) return 0;}while((c=nextc())!=-1 &&parser_is_identchar());pushback(c);break;}tokfix();len=lex_p-lex_pbeg;lex_goto_eol(parser);lex_strterm=rb_node_newnode(NODE_HEREDOC, STR_NEW(tok(), toklen()), len, lex_lastline);nd_set_line(lex_strterm, ruby_sourceline);ripper_flush(parser);return term== '`'?tXSTRING_BEG:tSTRING_BEG;}static voidparser_heredoc_restore(struct parser_params *parser, NODE *here){VALUE line;line=here->nd_orig;lex_lastline=line;lex_pbeg=RSTRING_PTR(line);lex_pend=lex_pbeg+RSTRING_LEN(line);lex_p=lex_pbeg+here->nd_nth;heredoc_end=ruby_sourceline;ruby_sourceline=nd_line(here);dispose_string(here->nd_lit);rb_gc_force_recycle((VALUE) here);ripper_flush(parser);}static intparser_whole_match_p(struct parser_params *parser, const char *eos, long len, int indent){const char *p=lex_pbeg;long n;if(indent){while(*p &&ISSPACE(*p)) p++;}n=lex_pend-(p+len);if(n< 0||(n > 0 &&p[len]!= '\n'&&p[len]!= '\r')) return FALSE;return strncmp(eos, p, len)==0;}#define dispatch_heredoc_end() static intparser_here_document(struct parser_params *parser, NODE *here){int c, func, indent=0;const char *eos,*p,*pend;long len;VALUE str=0;rb_encoding *enc=current_enc;eos=RSTRING_PTR(here->nd_lit);len=RSTRING_LEN(here->nd_lit)-1;indent=(func=*eos++)&STR_FUNC_INDENT;if((c=nextc())==-1){error:compile_error(PARSER_ARG"can't find string \"%s\" anywhere before EOF", eos);restore:heredoc_restore(lex_strterm);lex_strterm=0;return 0;}if(was_bol()&&whole_match_p(eos, len, indent)){dispatch_heredoc_end();heredoc_restore(lex_strterm);return tSTRING_END;}if(!(func &STR_FUNC_EXPAND)){do{p=RSTRING_PTR(lex_lastline);pend=lex_pend;if(pend > p){switch(pend[-1]){case '\n':if(--pend==p||pend[-1]!= '\r'){pend++;break;}case '\r':--pend;}}if(str) rb_str_cat(str, p, pend-p);else str=STR_NEW(p, pend-p);if(pend< lex_pend) rb_str_cat(str,"\n", 1);lex_goto_eol(parser);if(nextc()==-1){if(str) dispose_string(str);goto error;}}while(!whole_match_p(eos, len, indent));}else{newtok();if(c== '#'){int t=parser_peek_variable_name(parser);if(t) return t;tokadd('#');c=nextc();}do{pushback(c);if((c=tokadd_string(func, '\n', 0, NULL,&enc))==-1){if(parser->eofp) goto error;goto restore;}if(c!= '\n'){set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));flush_string_content(enc);return tSTRING_CONTENT;}tokadd(nextc());if((c=nextc())==-1) goto error;}while(!whole_match_p(eos, len, indent));str=STR_NEW3(tok(), toklen(), enc, func);}dispatch_heredoc_end();heredoc_restore(lex_strterm);lex_strterm=NEW_STRTERM(-1, 0, 0);set_yylval_str(str);return tSTRING_CONTENT;}static voidarg_ambiguous_gen(struct parser_params *parser){rb_warning0("ambiguous first argument; put parentheses or even spaces");}#define arg_ambiguous() static IDformal_argument_gen(struct parser_params *parser, ID lhs){if(!is_local_id(lhs)) yyerror("formal argument must be local variable");shadowing_lvar(lhs);return lhs;}static intlvar_defined_gen(struct parser_params *parser, ID id){return(dyna_in_block()&&dvar_defined_get(id))||local_id(id);}static longparser_encode_length(struct parser_params *parser, const char *name, long len){long nlen;if(len > 5 &&name[nlen=len-5]== '-'){if(rb_memcicmp(name+nlen+1,"unix", 4)==0) return nlen;}if(len > 4 &&name[nlen=len-4]== '-'){if(rb_memcicmp(name+nlen+1,"dos", 3)==0) return nlen;if(rb_memcicmp(name+nlen+1,"mac", 3)==0 &&!(len==8 &&rb_memcicmp(name,"utf8-mac", len)==0)) return nlen;}return len;}static voidparser_set_encode(struct parser_params *parser, const char *name){int idx=rb_enc_find_index(name);rb_encoding *enc;VALUE excargs[3];if(idx< 0){excargs[1]=rb_sprintf("unknown encoding name: %s", name);error:excargs[0]=rb_eArgError;excargs[2]=rb_make_backtrace();rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline));rb_exc_raise(rb_make_exception(3, excargs));}enc=rb_enc_from_index(idx);if(!rb_enc_asciicompat(enc)){excargs[1]=rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));goto error;}parser->enc=enc;if(ruby_debug_lines){long i, n=RARRAY_LEN(ruby_debug_lines);const VALUE *p=RARRAY_PTR(ruby_debug_lines);for(i=0;i< n;++i){rb_enc_associate_index(*p, idx);}}}static intcomment_at_top(struct parser_params *parser){const char *p=lex_pbeg,*pend=lex_p-1;if(parser->line_count!=(parser->has_shebang?2:1)) return 0;while(p< pend){if(!ISSPACE(*p)) return 0;p++;}return 1;}typedef long(*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);typedef void(*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);static voidmagic_comment_encoding(struct parser_params *parser, const char *name, const char *val){if(!comment_at_top(parser)){return;}parser_set_encode(parser, val);}static voidparser_set_token_info(struct parser_params *parser, const char *name, const char *val){int *p=&parser->parser_token_info_enabled;switch(*val){case 't':case 'T':if(strcasecmp(val,"true")==0){*p=TRUE;return;}break;case 'f':case 'F':if(strcasecmp(val,"false")==0){*p=FALSE;return;}break;}rb_compile_warning(ruby_sourcefile, ruby_sourceline,"invalid value for %s: %s", name, val);}struct magic_comment{const char *name;rb_magic_comment_setter_t func;rb_magic_comment_length_t length;};static const struct magic_comment magic_comments[]={{"coding", magic_comment_encoding, parser_encode_length},{"encoding", magic_comment_encoding, parser_encode_length},{"warn_indent", parser_set_token_info},};static const char *magic_comment_marker(const char *str, long len){long i=2;while(i< len){switch(str[i]){case '-':if(str[i-1]== '*'&&str[i-2]== '-'){return str+i+1;}i+=2;break;case '*':if(i+1 >=len) return 0;if(str[i+1]!= '-'){i+=4;}else if(str[i-1]!= '-'){i+=2;}else{return str+i+2;}break;default:i+=3;break;}}return 0;}static intparser_magic_comment(struct parser_params *parser, const char *str, long len){VALUE name=0, val=0;const char *beg,*end,*vbeg,*vend;#define str_copy(_s, _p, _n) if(len<=7) return FALSE;if(!(beg=magic_comment_marker(str, len))) return FALSE;if(!(end=magic_comment_marker(beg, str+len-beg))) return FALSE;str=beg;len=end-beg-3;while(len > 0){const struct magic_comment *p=magic_comments;char *s;int i;long n=0;for(;len > 0 &&*str;str++,--len){switch(*str){case '\'':case '"': case ':': case ';': continue; } if (!ISSPACE(*str)) break; } for (beg = str; len > 0; str++, --len) { switch (*str) { case '\'': case '"':case ':':case ';':break;default:if(ISSPACE(*str)) break;continue;}break;}for(end=str;len > 0 &&ISSPACE(*str);str++,--len);if(!len) break;if(*str!= ':') continue;do str++;while(--len > 0 &&ISSPACE(*str));if(!len) break;if(*str== '"') { for (vbeg = ++str; --len > 0 && *str != '"';str++){if(*str== '\\'){--len;++str;}}vend=str;if(len){--len;++str;}}else{for(vbeg=str;len > 0 &&*str!= '"' && *str != ';' && !ISSPACE(*str); --len, str++); vend = str; } while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++; n = end - beg; str_copy(name, beg, n); s = RSTRING_PTR(name); for (i = 0; i < n; ++i) { if (s[i] == '-') s[i] = '_'; } do { if (STRNCASECMP(p->name, s, n) == 0) { n = vend - vbeg; if (p->length) { n = (*p->length)(parser, vbeg, n); } str_copy(val, vbeg, n); (*p->func)(parser, s, RSTRING_PTR(val)); break; } } while (++p < magic_comments + numberof(magic_comments)); } return TRUE;}static voidset_file_encoding(struct parser_params *parser, const char *str, const char *send){ int sep = 0; const char *beg = str; VALUE s; for (;;) { if (send - str <= 6) return; switch (str[6]) { case 'C': case 'c': str += 6; continue; case 'O': case 'o': str += 5; continue; case 'D': case 'd': str += 4; continue; case 'I': case 'i': str += 3; continue; case 'N': case 'n': str += 2; continue; case 'G': case 'g': str += 1; continue; case '=': case ':': sep = 1; str += 6; break; default: str += 6; if (ISSPACE(*str)) break; continue; } if (STRNCASECMP(str-6, "coding", 6) == 0) break; } for (;;) { do { if (++str >= send) return; } while (ISSPACE(*str)); if (sep) break; if (*str != '=' && *str != ':') return; sep = 1; str++; } beg = str; while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send); s = rb_str_new(beg, parser_encode_length(parser, beg, str - beg)); parser_set_encode(parser, RSTRING_PTR(s)); rb_str_resize(s, 0);}static voidparser_prepare(struct parser_params *parser){ int c = nextc(); switch (c) { case '#': if (peek('!')) parser->has_shebang = 1; break; case 0xef: if (lex_pend - lex_p >= 2 && (unsigned char)lex_p[0] == 0xbb && (unsigned char)lex_p[1] == 0xbf) { parser->enc = rb_utf8_encoding(); lex_p += 2; lex_pbeg = lex_p; return; } break; case EOF: return; } pushback(c); parser->enc = rb_enc_get(lex_lastline);}#define IS_ARG() #define IS_END() #define IS_BEG() #define IS_SPCARG(c) #define IS_LABEL_POSSIBLE() #define IS_LABEL_SUFFIX(n) #define IS_AFTER_OPERATOR() #define ambiguous_operator(op, syn) #define warn_balanced(op, syn) static intparser_yylex(struct parser_params *parser){ register int c; int space_seen = 0; int cmd_state; enum lex_state_e last_state; rb_encoding *enc; int mb; if (lex_strterm) { int token; if (nd_type(lex_strterm) == NODE_HEREDOC) { token = here_document(lex_strterm); if (token == tSTRING_END) { lex_strterm = 0; lex_state = EXPR_END; } } else { token = parse_string(lex_strterm); if (token == tSTRING_END || token == tREGEXP_END) { rb_gc_force_recycle((VALUE)lex_strterm); lex_strterm = 0; lex_state = EXPR_END; } } return token; } cmd_state = command_start; command_start = FALSE; retry: last_state = lex_state; switch (c = nextc()) { case '\0': case '\004': case '\032': case -1: return 0; case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; goto retry; case '#': if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) { if (comment_at_top(parser)) { set_file_encoding(parser, lex_p, lex_pend); } } lex_p = lex_pend; case '\n': if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT)) { goto retry; } while ((c = nextc())) { switch (c) { case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; break; case '.': { if ((c = nextc()) != '.') { pushback(c); pushback('.'); goto retry; } } default: --ruby_sourceline; lex_nextline = lex_lastline; case -1: lex_goto_eol(parser); goto normal_newline; } } normal_newline: command_start = TRUE; lex_state = EXPR_BEG; return '\n'; case '*': if ((c = nextc()) == '*') { if ((c = nextc()) == '=') { set_yylval_id(tPOW); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`**'interpreted as argument prefix"); c = tDSTAR; } else if (IS_BEG()) { c = tDSTAR; } else { warn_balanced("**", "argument prefix"); c = tPOW; } } else { if (c == '=') { set_yylval_id('*'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`*'interpreted as argument prefix"); c = tSTAR; } else if (IS_BEG()) { c = tSTAR; } else { warn_balanced("*", "argument prefix"); c = '*'; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '!': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return '!'; } } else { lex_state = EXPR_BEG; } if (c == '=') { return tNEQ; } if (c == '~') { return tNMATCH; } pushback(c); return '!'; case '=': if (was_bol()) { if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) { for (;;) { lex_goto_eol(parser); c = nextc(); if (c == -1) { compile_error(PARSER_ARG "embedded document meets end of file"); return 0; } if (c != '=') continue; if (strncmp(lex_p, "end", 3) == 0 && (lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) { break; } } lex_goto_eol(parser); goto retry; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { if ((c = nextc()) == '=') { return tEQQ; } pushback(c); return tEQ; } if (c == '~') { return tMATCH; } else if (c == '>') { return tASSOC; } pushback(c); return '='; case '<': last_state = lex_state; c = nextc(); if (c == '<' && !IS_lex_state(EXPR_DOT | EXPR_CLASS) && !IS_END() && (!IS_ARG() || space_seen)) { int token = heredoc_identifier(); if (token) return token; } if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; } else { if (IS_lex_state(EXPR_CLASS)) command_start = TRUE; lex_state = EXPR_BEG; } if (c == '=') { if ((c = nextc()) == '>') { return tCMP; } pushback(c); return tLEQ; } if (c == '<') { if ((c = nextc()) == '=') { set_yylval_id(tLSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); warn_balanced("<<", "here document"); return tLSHFT; } pushback(c); return '<'; case '>': lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { return tGEQ; } if (c == '>') { if ((c = nextc()) == '=') { set_yylval_id(tRSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tRSHFT; } pushback(c); return '>'; case '"':lex_strterm=NEW_STRTERM(str_dquote, '"', 0); return tSTRING_BEG; case '`': if (IS_lex_state(EXPR_FNAME)) { lex_state = EXPR_ENDFN; return c; } if (IS_lex_state(EXPR_DOT)) { if (cmd_state) lex_state = EXPR_CMDARG; else lex_state = EXPR_ARG; return c; } lex_strterm = NEW_STRTERM(str_xquote, '`', 0); return tXSTRING_BEG; case '\'': lex_strterm = NEW_STRTERM(str_squote, '\'', 0); return tSTRING_BEG; case '?': if (IS_END()) { lex_state = EXPR_VALUE; return '?'; } c = nextc(); if (c == -1) { compile_error(PARSER_ARG "incomplete character syntax"); return 0; } if (rb_enc_isspace(c, current_enc)) { if (!IS_ARG()) { int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; case '\v': c2 = 'v'; break; case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2) { rb_warnI("invalid character syntax;use?\\%c", c2); } } ternary: pushback(c); lex_state = EXPR_VALUE; return '?'; } newtok(); enc = current_enc; if (!parser_isascii()) { if (tokadd_mbchar(c) == -1) return 0; } else if ((rb_enc_isalnum(c, current_enc) || c == '_') && lex_p < lex_pend && is_identchar(lex_p, lex_pend, current_enc)) { goto ternary; } else if (c == '\\') { if (peek('u')) { nextc(); c = parser_tokadd_utf8(parser, &enc, 0, 0, 0); if (0x80 <= c) { tokaddmbc(c, enc); } else { tokadd(c); } } else if (!lex_eol_p() && !(c = *lex_p, ISASCII(c))) { nextc(); if (tokadd_mbchar(c) == -1) return 0; } else { c = read_escape(0, &enc); tokadd(c); } } else { tokadd(c); } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0)); lex_state = EXPR_END; return tCHAR; case '&': if ((c = nextc()) == '&') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tANDOP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tANDOP; } else if (c == '=') { set_yylval_id('&'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`&'interpreted as argument prefix"); c = tAMPER; } else if (IS_BEG()) { c = tAMPER; } else { warn_balanced("&", "argument prefix"); c = '&'; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '|': if ((c = nextc()) == '|') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tOROP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tOROP; } if (c == '=') { set_yylval_id('|'); lex_state = EXPR_BEG; return tOP_ASGN; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; pushback(c); return '|'; case '+': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUPLUS; } pushback(c); return '+'; } if (c == '=') { set_yylval_id('+'); lex_state = EXPR_BEG; return tOP_ASGN; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { c = '+'; goto start_num; } return tUPLUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("+", "unary operator"); return '+'; case '-': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUMINUS; } pushback(c); return '-'; } if (c == '=') { set_yylval_id('-'); lex_state = EXPR_BEG; return tOP_ASGN; } if (c == '>') { lex_state = EXPR_ENDFN; return tLAMBDA; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { return tUMINUS_NUM; } return tUMINUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("-", "unary operator"); return '-'; case '.': lex_state = EXPR_BEG; if ((c = nextc()) == '.') { if ((c = nextc()) == '.') { return tDOT3; } pushback(c); return tDOT2; } pushback(c); if (c != -1 && ISDIGIT(c)) { yyerror("no.< digit > floating literal anymore;put 0 before dot"); } lex_state = EXPR_DOT; return '.'; start_num: case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { int is_float, seen_point, seen_e, nondigit; is_float = seen_point = seen_e = nondigit = 0; lex_state = EXPR_END; newtok(); if (c == '-' || c == '+') { tokadd(c); c = nextc(); } if (c == '0') {#define no_digits() int start = toklen(); c = nextc(); if (c == 'x' || c == 'X') { c = nextc(); if (c != -1 && ISXDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISXDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 16, FALSE)); return tINTEGER; } if (c == 'b' || c == 'B') { c = nextc(); if (c == '0' || c == '1') { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c != '0' && c != '1') break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 2, FALSE)); return tINTEGER; } if (c == 'd' || c == 'D') { c = nextc(); if (c != -1 && ISDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE)); return tINTEGER; } if (c == '_') { goto octal_number; } if (c == 'o' || c == 'O') { c = nextc(); if (c == -1 || c == '_' || !ISDIGIT(c)) { no_digits(); } } if (c >= '0' && c <= '7') { octal_number: do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c < '0' || c > '9') break; if (c > '7') goto invalid_octal; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); if (toklen() > start) { pushback(c); tokfix(); if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 8, FALSE)); return tINTEGER; } if (nondigit) { pushback(c); goto trailing_uc; } } if (c > '7' && c <= '9') { invalid_octal: yyerror("Invalid octal digit"); } else if (c == '.' || c == 'e' || c == 'E') { tokadd('0'); } else { pushback(c); set_yylval_literal(INT2FIX(0)); return tINTEGER; } } for (;;) { switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': nondigit = 0; tokadd(c); break; case '.': if (nondigit) goto trailing_uc; if (seen_point || seen_e) { goto decode_num; } else { int c0 = nextc(); if (c0 == -1 || !ISDIGIT(c0)) { pushback(c0); goto decode_num; } c = c0; } tokadd('.'); tokadd(c); is_float++; seen_point++; nondigit = 0; break; case 'e': case 'E': if (nondigit) { pushback(c); c = nondigit; goto decode_num; } if (seen_e) { goto decode_num; } tokadd(c); seen_e++; is_float++; nondigit = c; c = nextc(); if (c != '-' && c != '+') continue; tokadd(c); nondigit = c; break; case '_': if (nondigit) goto decode_num; nondigit = c; break; default: goto decode_num; } c = nextc(); } decode_num: pushback(c); if (nondigit) { char tmp[30]; trailing_uc: snprintf(tmp, sizeof(tmp), "trailing`%c'in number", nondigit); yyerror(tmp); } tokfix(); if (is_float) { double d = strtod(tok(), 0); if (errno == ERANGE) { rb_warningS("Float%s out of range", tok()); errno = 0; } set_yylval_literal(DBL2NUM(d)); return tFLOAT; } set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE)); return tINTEGER; } case ')': case '] | __pad18__ |
| ONIG_EXTERN const UChar | OnigEncISO_8859_1_ToLowerCaseTable [] |
| ONIG_EXTERN const UChar | OnigEncISO_8859_1_ToUpperCaseTable [] |
| ONIG_EXTERN OnigEncoding | OnigEncDefaultCharEncoding |
| ONIG_EXTERN const UChar | OnigEncAsciiToLowerCaseTable [] |
| ONIG_EXTERN const UChar | OnigEncAsciiToUpperCaseTable [] |
| ONIG_EXTERN const unsigned short | OnigEncAsciiCtypeTable [] |
| pure_parser parse | param |
| top_compstmt | __pad0__ |
| fixup_nodes & | deferred_nodes |
| top_stmts | __pad1__ = $1 |
| top_stmt | |
| top_stmt | __pad2__ |
| top_stmt | bodystmt = NEW_BEGIN(0) |
| compstmt | __pad3__ |
| stmts | __pad4__ = $1 |
| stmt_or_begin | |
| error | stmt |
| stmt_or_begin | __pad5__ |
| keyword_BEGIN | |
| command_asgn | __pad6__ |
| lhs | |
| expr | __pad7__ |
| expr expr keyword_or | expr |
| command_call | |
| arg | |
| expr_value | __pad8__ |
| command_call | __pad9__ |
| block_command | __pad10__ |
| block_command | cmd_brace_block |
| < num > opt_block_param | compstmt |
| fcall | __pad11__ |
| command | __pad12__ |
| nd_args = $2 | |
| nd_iter = $1 | |
| primary_value operation2 command_args prec | tLOWEST |
| keyword_super | command_args |
| keyword_return | call_args |
| mlhs | __pad13__ |
| mlhs_inner | __pad14__ |
| mlhs_inner | mlhs_basic |
| mlhs_inner mlhs_head | mlhs_item |
| mlhs_head tSTAR | mlhs_node |
| mlhs_head tSTAR | mlhs_post |
| mlhs_head | tSTAR |
| mlhs_item | __pad15__ |
| mlhs_head | __pad16__ |
| mlhs_node | __pad17__ |
| mlhs_node | keyword_variable |
| case | __pad19__ |
| else | lex_state = EXPR_ENDARG |
| return | c |
| case | __pad20__ |
| return | tSYMBEG |
| case | __pad21__ |
| case return | tREGEXP_BEG |
| return | |
| case | __pad22__ |
| return | tOP_ASGN |
| case | |
| __pad23__ | |
| command_start = TRUE | |
| __pad24__ | |
| case | __pad25__ |
| else | |
| #define ambiguous_operator | ( | op, | |
| syn | |||
| ) |
| #define arg_ambiguous | ( | ) | (arg_ambiguous_gen(parser), 1) |
| #define arg_append | ( | h, | |
| t | |||
| ) | arg_append_gen(parser,(h),(t)) |
| #define arg_concat | ( | h, | |
| t | |||
| ) | arg_concat_gen(parser,(h),(t)) |
| #define arg_var | ( | id | ) | arg_var_gen(parser, (id)) |
| #define aryset | ( | node1, | |
| node2 | |||
| ) | aryset_gen(parser, (node1), (node2)) |
| #define assignable | ( | id, | |
| node | |||
| ) | assignable_gen(parser, (id), (node)) |
| #define assignable_result | ( | x | ) | (x) |
| #define attrset | ( | node, | |
| id | |||
| ) | attrset_gen(parser, (node), (id)) |
| #define BITSTACK_LEXPOP | ( | stack | ) | ((stack) = ((stack) >> 1) | ((stack) & 1)) |
| #define BITSTACK_PUSH | ( | stack, | |
| n | |||
| ) | ((stack) = ((stack)<<1)|((n)&1)) |
| #define block_append | ( | h, | |
| t | |||
| ) | block_append_gen(parser,(h),(t)) |
| #define block_dup_check | ( | n1, | |
| n2 | |||
| ) | block_dup_check_gen(parser,(n1),(n2)) |
| #define call_bin_op | ( | recv, | |
| id, | |||
| arg1 | |||
| ) | call_bin_op_gen(parser, (recv),(id),(arg1)) |
| #define call_uni_op | ( | recv, | |
| id | |||
| ) | call_uni_op_gen(parser, (recv),(id)) |
| #define CMDARG_LEXPOP | ( | ) | BITSTACK_LEXPOP(cmdarg_stack) |
| #define CMDARG_P | ( | ) | BITSTACK_SET_P(cmdarg_stack) |
| #define CMDARG_POP | ( | ) | BITSTACK_POP(cmdarg_stack) |
| #define CMDARG_PUSH | ( | n | ) | BITSTACK_PUSH(cmdarg_stack, (n)) |
| #define compile_error parser->nerr++,rb_compile_error_with_enc |
| #define COND_LEXPOP | ( | ) | BITSTACK_LEXPOP(cond_stack) |
| #define COND_P | ( | ) | BITSTACK_SET_P(cond_stack) |
| #define COND_POP | ( | ) | BITSTACK_POP(cond_stack) |
| #define COND_PUSH | ( | n | ) | BITSTACK_PUSH(cond_stack, (n)) |
| #define dispatch_heredoc_end | ( | ) | ((void)0) |
| #define dsym_node | ( | node | ) | dsym_node_gen(parser, (node)) |
| #define dvar_curr | ( | id | ) | dvar_curr_gen(parser, (id)) |
| #define dvar_defined | ( | id | ) | dvar_defined_gen(parser, (id), 0) |
| #define dvar_defined_get | ( | id | ) | dvar_defined_gen(parser, (id), 1) |
| #define dyna_in_block | ( | ) | dyna_in_block_gen(parser) |
| #define dyna_pop | ( | node | ) | dyna_pop_gen(parser, (node)) |
| #define dyna_push | ( | ) | dyna_push_gen(parser) |
| #define ENABLE_SELECTOR_NAMESPACE 0 |
| #define ENC_SINGLE | ( | cr | ) | ((cr)==ENC_CODERANGE_7BIT) |
| #define ESCAPE_CONTROL 1 |
| #define ESCAPE_META 2 |
| #define evstr2dstr | ( | n | ) | evstr2dstr_gen(parser,(n)) |
| #define flush_string_content | ( | enc | ) | ((void)(enc)) |
| #define formal_argument | ( | id | ) | formal_argument_gen(parser, (id)) |
| #define gettable | ( | id | ) | gettable_gen(parser,(id)) |
| #define here_document | ( | n | ) | parser_here_document(parser,(n)) |
| #define heredoc_identifier | ( | ) | parser_heredoc_identifier(parser) |
| #define heredoc_restore | ( | n | ) | parser_heredoc_restore(parser,(n)) |
| #define id_type | ( | id | ) | (is_notop_id(id) ? (int)((id)&ID_SCOPE_MASK) : -1) |
| #define internal_id | ( | ) | internal_id_gen(parser) |
| #define IS_AFTER_OPERATOR | ( | ) | IS_lex_state(EXPR_FNAME | EXPR_DOT) |
| #define IS_ARG | ( | ) | IS_lex_state(EXPR_ARG_ANY) |
| #define is_asgn_or_id | ( | id | ) |
| #define is_attrset_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET) |
| #define IS_BEG | ( | ) | IS_lex_state(EXPR_BEG_ANY) |
| #define is_class_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS) |
| #define is_const_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST) |
| #define IS_END | ( | ) | IS_lex_state(EXPR_END_ANY) |
| #define is_global_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) |
| #define is_instance_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) |
| #define is_junk_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK) |
| #define IS_LABEL_POSSIBLE | ( | ) | ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG()) |
| #define IS_lex_state | ( | ls | ) | IS_lex_state_for(lex_state, (ls)) |
| #define is_local_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) |
| #define is_notop_id | ( | id | ) | ((id)>tLAST_OP_ID) |
| #define lex_goto_eol | ( | parser | ) | ((parser)->parser_lex_p = (parser)->parser_lex_pend) |
| #define lex_strterm (parser->parser_lex_strterm) |
| #define list_append | ( | l, | |
| i | |||
| ) | list_append_gen(parser,(l),(i)) |
| #define list_concat | ( | h, | |
| t | |||
| ) | list_concat_gen(parser,(h),(t)) |
| #define literal_concat | ( | h, | |
| t | |||
| ) | literal_concat_gen(parser,(h),(t)) |
| #define local_id | ( | id | ) | local_id_gen(parser, (id)) |
| #define local_pop | ( | ) | local_pop_gen(parser) |
| #define local_push | ( | top | ) | local_push_gen(parser,(top)) |
| #define local_tbl | ( | ) | local_tbl_gen(parser) |
| #define local_var | ( | id | ) | local_var_gen(parser, (id)) |
| #define lvar_defined | ( | id | ) | lvar_defined_gen(parser, (id)) |
| #define match_op | ( | node1, | |
| node2 | |||
| ) | match_op_gen(parser, (node1), (node2)) |
| #define mixed_error | ( | enc1, | |
| enc2 | |||
| ) |
| #define mixed_escape | ( | beg, | |
| enc1, | |||
| enc2 | |||
| ) |
| #define nd_term | ( | node | ) | SIGN_EXTEND((node)->u2.id, CHAR_BIT*2) |
| #define new_args | ( | f, | |
| o, | |||
| r, | |||
| p, | |||
| t | |||
| ) | new_args_gen(parser, (f),(o),(r),(p),(t)) |
| #define new_args_tail | ( | k, | |
| kr, | |||
| b | |||
| ) | new_args_tail_gen(parser, (k),(kr),(b)) |
| #define new_attr_op_assign | ( | lhs, | |
| type, | |||
| attr, | |||
| op, | |||
| rhs | |||
| ) | new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs)) |
| #define new_bv | ( | id | ) | new_bv_gen(parser, (id)) |
| #define new_const_op_assign | ( | lhs, | |
| op, | |||
| rhs | |||
| ) | new_const_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define new_evstr | ( | n | ) | new_evstr_gen(parser,(n)) |
| #define new_op_assign | ( | lhs, | |
| op, | |||
| rhs | |||
| ) | new_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define NEW_STRTERM | ( | func, | |
| term, | |||
| paren | |||
| ) | rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) |
| #define new_yield | ( | node | ) | new_yield_gen(parser, (node)) |
| #define NEWHEAP | ( | ) | rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0) |
| #define newtok | ( | ) | parser_newtok(parser) |
| #define nextc | ( | ) | parser_nextc(parser) |
| #define no_digits | ( | ) | do {yyerror("numeric literal without digits"); return 0;} while (0) |
| #define node_assign | ( | node1, | |
| node2 | |||
| ) | node_assign_gen(parser, (node1), (node2)) |
| #define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */ |
| #define NODE_STRTERM NODE_ZARRAY /* nothing to gc */ |
| #define parse_string | ( | n | ) | parser_parse_string(parser,(n)) |
| #define PARSER_ARG ruby_sourcefile, ruby_sourceline, current_enc, |
| #define PARSER_DEBUG 0 |
| #define parser_encoding_name | ( | ) | (current_enc->name) |
| #define parser_is_identchar | ( | ) | (!parser->eofp && is_identchar((lex_p-1),lex_pend,current_enc)) |
| #define parser_mbclen | ( | ) | mbclen((lex_p-1),lex_pend,current_enc) |
| #define parser_precise_mbclen | ( | ) | rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc) |
| #define parser_warn | ( | node, | |
| mesg | |||
| ) | parser_warn(parser, (node), (mesg)) |
| #define parser_warning | ( | node, | |
| mesg | |||
| ) | parser_warning(parser, (node), (mesg)) |
| #define pushback | ( | c | ) | parser_pushback(parser, (c)) |
| #define rb_backref_error | ( | n | ) | rb_backref_error_gen(parser,(n)) |
| #define rb_compile_error rb_compile_error_with_enc |
| #define rb_node_newnode | ( | type, | |
| a1, | |||
| a2, | |||
| a3 | |||
| ) | node_newnode(parser, (type), (a1), (a2), (a3)) |
| #define rb_warn0 | ( | fmt | ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define rb_warn4S | ( | file, | |
| line, | |||
| fmt, | |||
| a | |||
| ) | rb_compile_warn((file), (line), (fmt), (a)) |
| #define rb_warnI | ( | fmt, | |
| a | |||
| ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define rb_warning0 | ( | fmt | ) | rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define rb_warningS | ( | fmt, | |
| a | |||
| ) | rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define rb_warnS | ( | fmt, | |
| a | |||
| ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define RE_OPTION_ENCODING | ( | e | ) | (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT) |
| #define RE_OPTION_ENCODING_IDX | ( | o | ) | (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff) |
| #define RE_OPTION_ENCODING_NONE | ( | o | ) | ((o)&RE_OPTION_ARG_ENCODING_NONE) |
| #define read_escape | ( | flags, | |
| e | |||
| ) | parser_read_escape(parser, (flags), (e)) |
| #define reduce_nodes | ( | n | ) | reduce_nodes_gen(parser,(n)) |
| #define reg_compile | ( | str, | |
| options | |||
| ) | reg_compile_gen(parser, (str), (options)) |
| #define reg_fragment_check | ( | str, | |
| options | |||
| ) | reg_fragment_check_gen(parser, (str), (options)) |
| #define reg_fragment_setenc | ( | str, | |
| options | |||
| ) | reg_fragment_setenc_gen(parser, (str), (options)) |
| #define reg_named_capture_assign | ( | regexp, | |
| match | |||
| ) | reg_named_capture_assign_gen(parser,(regexp),(match)) |
| #define regx_options | ( | ) | parser_regx_options(parser) |
| #define ret_args | ( | node | ) | ret_args_gen(parser, (node)) |
| #define ruby_debug_lines (parser->debug_lines) |
| #define ruby_eval_tree_begin (parser->parser_eval_tree_begin) |
| #define set_yylval_id | ( | x | ) | (yylval.id = (x)) |
| #define set_yylval_literal | ( | x | ) | (yylval.node = NEW_LIT(x)) |
| #define set_yylval_name | ( | x | ) | (yylval.id = (x)) |
| #define set_yylval_node | ( | x | ) | (yylval.node = (x)) |
| #define set_yylval_num | ( | x | ) | (yylval.num = (x)) |
| #define set_yylval_str | ( | x | ) | (yylval.node = NEW_STR(x)) |
| #define shadowing_lvar | ( | name | ) | shadowing_lvar_gen(parser, (name)) |
| #define SIGN_EXTEND | ( | x, | |
| n | |||
| ) | (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1)) |
| #define SPECIAL_PUNCT | ( | idx | ) |
| #define str_copy | ( | _s, | |
| _p, | |||
| _n | |||
| ) |
| #define STR_FUNC_ESCAPE 0x01 |
| #define STR_FUNC_EXPAND 0x02 |
| #define STR_FUNC_INDENT 0x20 |
| #define STR_FUNC_QWORDS 0x08 |
| #define STR_FUNC_REGEXP 0x04 |
| #define STR_FUNC_SYMBOL 0x10 |
| #define STR_NEW | ( | p, | |
| n | |||
| ) | rb_enc_str_new((p),(n),current_enc) |
| #define STR_NEW0 | ( | ) | rb_enc_str_new(0,0,current_enc) |
| #define STR_NEW2 | ( | p | ) | rb_enc_str_new((p),strlen(p),current_enc) |
| #define STR_NEW3 | ( | p, | |
| n, | |||
| e, | |||
| func | |||
| ) | parser_str_new((p),(n),(e),(func),current_enc) |
| #define subnodes | ( | n1, | |
| n2 | |||
| ) |
| #define tok | ( | ) | tokenbuf |
| #define tok_hex | ( | numlen | ) | parser_tok_hex(parser, (numlen)) |
| #define TOK_INTERN | ( | mb | ) | rb_intern3(tok(), toklen(), current_enc) |
| #define tokadd | ( | c | ) | parser_tokadd(parser, (c)) |
| #define tokadd_escape | ( | e | ) | parser_tokadd_escape(parser, (e)) |
| #define tokadd_mbchar | ( | c | ) | parser_tokadd_mbchar(parser, (c)) |
| #define tokadd_string | ( | f, | |
| t, | |||
| p, | |||
| n, | |||
| e | |||
| ) | parser_tokadd_string(parser,(f),(t),(p),(n),(e)) |
| #define tokaddmbc | ( | c, | |
| enc | |||
| ) | parser_tokaddmbc(parser, (c), (enc)) |
| #define token_info_pop | ( | token | ) | (RTEST(ruby_verbose) ? token_info_pop(parser, (token)) : (void)0) |
| #define token_info_push | ( | token | ) | (RTEST(ruby_verbose) ? token_info_push(parser, (token)) : (void)0) |
| #define toklen | ( | ) | tokidx |
| #define tokspace | ( | n | ) | parser_tokspace(parser, (n)) |
| #define value_expr | ( | node | ) | value_expr_gen(parser, (node) = remove_begin(node)) |
| #define void_expr | ( | node | ) | void_expr0((node) = remove_begin(node)) |
| #define void_expr0 | ( | node | ) | void_expr_gen(parser, (node)) |
| #define void_stmts | ( | node | ) | void_stmts_gen(parser, (node)) |
| #define warn_balanced | ( | op, | |
| syn | |||
| ) |
| #define whole_match_p | ( | e, | |
| l, | |||
| i | |||
| ) | parser_whole_match_p(parser,(e),(l),(i)) |
| #define YYCALLOC | ( | nelem, | |
| size | |||
| ) | rb_parser_calloc(parser, (nelem), (size)) |
| #define YYDEBUG 1 |
| #define yyerror | ( | msg | ) | parser_yyerror(parser, (msg)) |
| #define YYERROR_VERBOSE 1 |
| #define YYFREE | ( | ptr | ) | rb_parser_free(parser, (ptr)) |
| #define yylval (*((YYSTYPE*)(parser->parser_yylval))) |
| #define yylval_id | ( | ) | (yylval.id) |
| #define YYMALLOC | ( | size | ) | rb_parser_malloc(parser, (size)) |
| #define YYREALLOC | ( | ptr, | |
| size | |||
| ) | rb_parser_realloc(parser, (ptr), (size)) |
| #define YYSTACK_USE_ALLOCA 0 |
| typedef VALUE stack_type |
| typedef struct token_info token_info |
| enum lex_state_bits |
| enum lex_state_e |
| enum node_type |
| enum rb_econv_result_t |
| enum ruby_method_ids |
| enum ruby_special_consts |
| enum ruby_value_type |
| enum st_retval |
| enum st_retval |
| enum yytokentype |
| RUBY_EXTERN double acosh | ( | double | ) |
Definition at line 36 of file acosh.c.
References BIG_CRITERIA.
| void* alloca | ( | ) |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN double asinh | ( | double | ) |
Definition at line 52 of file acosh.c.
References BIG_CRITERIA, DBL_MANT_DIG, neg, and SMALL_CRITERIA.
|
static |
| RUBY_EXTERN double atanh | ( | double | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN double cbrt | ( | double | ) |
|
static |
| RUBY_EXTERN char* crypt | ( | const char * | , |
| const char * | |||
| ) |
Definition at line 500 of file crypt.c.
References _PASSWORD_EFMT1, a64toi, C_block::b, constdatablock, cryptresult, des_cipher(), des_setkey(), i, itoa64, and NULL.
| DEPRECATED | ( | void | rb_quad_packchar *, VALUE | ) |
| DEPRECATED | ( | VALUE | rb_quad_unpackconst char *, int | ) |
| DEPRECATED | ( | void | rb_thread_pollingvoid | ) |
| DEPRECATED | ( | int | rb_thread_selectint, fd_set *, fd_set *, fd_set *, struct timeval * | ) |
| DEPRECATED | ( | void | rb_check_safe_strVALUE | ) |
| DEPRECATED | ( | int | rb_proc_exec_nint, VALUE *, const char * | ) |
| DEPRECATED | ( | VALUE | rb_exec_arg_initint argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e | ) |
| DEPRECATED | ( | int | rb_exec_arg_addoptstruct rb_exec_arg *e, VALUE key, VALUE val | ) |
| DEPRECATED | ( | void | rb_exec_arg_fixupstruct rb_exec_arg *e | ) |
| DEPRECATED | ( | int | rb_run_exec_optionsconst struct rb_exec_arg *e, struct rb_exec_arg *s | ) |
| DEPRECATED | ( | int | rb_run_exec_options_errconst struct rb_exec_arg *e, struct rb_exec_arg *s, char *, size_t | ) |
| DEPRECATED | ( | int | rb_execconst struct rb_exec_arg * | ) |
| DEPRECATED | ( | int | rb_exec_errconst struct rb_exec_arg *, char *, size_t | ) |
| DEPRECATED | ( | rb_pid_t | rb_forkint *, int(*)(void *), void *, VALUE | ) |
| DEPRECATED | ( | rb_pid_t | rb_fork_errint *, int(*)(void *, char *, size_t), void *, VALUE, char *, size_t | ) |
| DEPRECATED | ( | VALUE | rb_struct_iv_getVALUE, const char * | ) |
| DEPRECATED | ( | VALUE | rb_thread_blocking_regionrb_blocking_function_t *func, void *data1, rb_unblock_function_t *ubf, void *data2 | ) |
|
static |
| RUBY_EXTERN int dup2 | ( | int | , |
| int | |||
| ) |
|
static |
|
static |
|
static |
| dyna_pop | ( | $< vars > | ) |
|
static |
|
staticread |
| RUBY_EXTERN int eaccess | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN double erf | ( | double | ) |
| RUBY_EXTERN double erfc | ( | double | ) |
|
static |
| RUBY_EXTERN int ffs | ( | int | ) |
| RUBY_EXTERN int finite | ( | double | ) |
| fixpos | ( | $$, | |
| $1 | |||
| ) | = $3 |
|
static |
| RUBY_EXTERN int flock | ( | int | , |
| int | |||
| ) |
|
static |
|
static |
| RUBY_EXTERN double hypot | ( | double | , |
| double | |||
| ) |
| if | ( | $2 | ) |
Definition at line 952 of file parse.y.
References NEW_RESCUE.
| if | ( | ! | $$ | ) |
| if | ( | c | = = ')' | ) |
Definition at line 7626 of file parse.y.
References arg_ambiguous, IS_SPCARG, lex_strterm, NEW_STRTERM, str_regexp, and tREGEXP_BEG.
| void Init_BareVM | ( | void | ) |
Definition at line 2394 of file vm.c.
References EXIT_FAILURE, Init_native_thread(), MEMZERO, rb_vm_struct::objspace, rb_objspace_alloc(), rb_thread_set_current_raw, ruby_mimmalloc(), ruby_thread_init_stack(), th_init(), rb_thread_struct::vm, and vm_init2().
| void Init_eval_method | ( | void | ) |
Definition at line 1618 of file vm_method.c.
References added, attached, idRespond_to, idRespond_to_missing, NOEX_PRIVATE, NOEX_PUBLIC, obj_respond_to(), obj_respond_to_missing(), object_id, rb_cModule, rb_define_method(), rb_define_private_method(), rb_eException, rb_intern, rb_mKernel, rb_mod_alias_method(), rb_mod_method_defined(), rb_mod_modfunc(), rb_mod_private(), rb_mod_private_method(), rb_mod_private_method_defined(), rb_mod_protected(), rb_mod_protected_method_defined(), rb_mod_public(), rb_mod_public_method(), rb_mod_public_method_defined(), rb_mod_remove_method(), rb_mod_undef_method(), rb_singleton_class(), rb_vm_top_self(), removed, REPLICATE_METHOD, singleton_added, singleton_removed, singleton_undefined, top_private(), top_public(), and undefined.
| void Init_ext | ( | void | ) |
Definition at line 2 of file dmyext.c.
Referenced by init_libraries_internal(), and require_libraries().
| void Init_File | ( | void | ) |
Definition at line 5488 of file file.c.
References define_filetest_function(), INT2FIX, LOCK_EX, LOCK_NB, LOCK_SH, LOCK_UN, O_BINARY, O_NONBLOCK, PATH_SEP, Qnil, rb_cIO, rb_cObject, rb_define_alloc_func(), rb_define_class(), rb_define_class_under(), rb_define_const(), rb_define_global_function(), rb_define_method(), rb_define_module(), rb_define_module_under(), rb_define_singleton_method(), rb_f_test(), rb_file_atime(), rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_chmod(), rb_file_chown(), rb_file_ctime(), rb_file_directory_p(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_exist_p(), rb_file_file_p(), rb_file_flock(), rb_file_grpowned_p(), rb_file_identical_p(), rb_file_lstat(), rb_file_mtime(), rb_file_owned_p(), rb_file_path(), rb_file_pipe_p(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_s_absolute_path(), rb_file_s_atime(), rb_file_s_basename(), rb_file_s_chmod(), rb_file_s_chown(), rb_file_s_ctime(), rb_file_s_dirname(), rb_file_s_expand_path(), rb_file_s_extname(), rb_file_s_ftype(), rb_file_s_join(), rb_file_s_lchmod, rb_file_s_lchown, rb_file_s_link, rb_file_s_lstat(), rb_file_s_mtime(), rb_file_s_path(), rb_file_s_readlink, rb_file_s_realdirpath(), rb_file_s_realpath(), rb_file_s_rename(), rb_file_s_size(), rb_file_s_split(), rb_file_s_stat(), rb_file_s_symlink, rb_file_s_truncate, rb_file_s_umask(), rb_file_s_unlink(), rb_file_s_utime(), rb_file_sgid_p(), rb_file_size(), rb_file_size_p(), rb_file_socket_p(), rb_file_sticky_p(), rb_file_suid_p(), rb_file_symlink_p(), rb_file_truncate, rb_file_world_readable_p(), rb_file_world_writable_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_file_zero_p(), rb_include_module(), rb_io_stat(), rb_mComparable, rb_obj_freeze(), rb_stat_atime(), rb_stat_b(), rb_stat_blksize(), rb_stat_blocks(), rb_stat_c(), rb_stat_cmp(), rb_stat_ctime(), rb_stat_d(), rb_stat_dev(), rb_stat_dev_major(), rb_stat_dev_minor(), rb_stat_f(), rb_stat_ftype(), rb_stat_gid(), rb_stat_grpowned(), rb_stat_init(), rb_stat_init_copy(), rb_stat_ino(), rb_stat_inspect(), rb_stat_l(), rb_stat_mode(), rb_stat_mtime(), rb_stat_nlink(), rb_stat_owned(), rb_stat_p(), rb_stat_r(), rb_stat_R(), rb_stat_rdev(), rb_stat_rdev_major(), rb_stat_rdev_minor(), rb_stat_S(), rb_stat_s(), rb_stat_s_alloc(), rb_stat_sgid(), rb_stat_size(), rb_stat_sticky(), rb_stat_suid(), rb_stat_uid(), rb_stat_w(), rb_stat_W(), rb_stat_wr(), rb_stat_ww(), rb_stat_x(), rb_stat_X(), rb_stat_z(), rb_str_new2, rb_usascii_str_new2, and rb_w32_init_file().
| void Init_heap | ( | void | ) |
Definition at line 1039 of file gc.c.
References init_heap().
|
static |
Definition at line 14 of file id.c.
References id_core_define_method, id_core_define_singleton_method, id_core_hash_from_ary, id_core_hash_merge_ary, id_core_hash_merge_kwd, id_core_hash_merge_ptr, id_core_set_method_alias, id_core_set_postexe, id_core_set_variable_alias, id_core_undef_method, idCFUNC, idEmptyP, idIFUNC, idNULL, idRespond_to, idRespond_to_missing, rb_usascii_encoding(), and REGISTER_SYMID.
| void Init_native_thread | ( | void | ) |
| void Init_newline | ( | void | ) |
Definition at line 183 of file newline.c.
References rb_cr_newline, rb_crlf_newline, rb_register_transcoder(), and rb_universal_newline.
| void Init_prelude | ( | void | ) |
| void Init_vm_backtrace | ( | void | ) |
Definition at line 944 of file vm_backtrace.c.
References backtrace_alloc(), backtrace_dump_data(), backtrace_load_data(), CLASS_OF, location_absolute_path_m(), location_base_label_m(), location_inspect_m(), location_label_m(), location_lineno_m(), location_path_m(), location_to_str_m(), rb_cArray, rb_cBacktrace, rb_cBacktraceLocation, rb_cObject, rb_cThread, rb_define_alloc_func(), rb_define_class_under(), rb_define_global_function(), rb_define_method(), rb_f_caller(), rb_f_caller_locations(), rb_marshal_define_compat(), rb_undef_alloc_func(), and rb_undef_method().
| void Init_vm_eval | ( | void | ) |
Definition at line 1944 of file vm_eval.c.
References rb_add_method(), rb_cBasicObject, rb_cModule, rb_define_global_function(), rb_define_method(), rb_define_private_method(), rb_f_block_given_p(), rb_f_catch(), rb_f_eval(), rb_f_local_variables(), rb_f_loop(), rb_f_public_send(), rb_f_send(), rb_f_throw(), rb_intern, rb_method_missing(), rb_mKernel, rb_mod_module_eval(), rb_mod_module_exec(), rb_obj_instance_eval(), rb_obj_instance_exec(), and VM_METHOD_TYPE_OPTIMIZED.
|
static |
| RUBY_EXTERN int isinf | ( | double | ) |
| RUBY_EXTERN int isnan | ( | double | ) |
Definition at line 8 of file isnan.c.
References double_ne().
| RUBY_EXTERN double lgamma_r | ( | double | , |
| int * | |||
| ) |
Definition at line 63 of file lgamma_r.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN void* memmove | ( | void * | , |
| const void * | , | ||
| size_t | |||
| ) |
| nd_set_line | ( | $$, | |
| $< num > | |||
| ) |
| fcall nd_set_line | ( | $$, | |
| tokline | |||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| NORETURN | ( | PRINTF_ARGS(void rb_compile_bug(const char *, int, const char *,...), 3, 4) | ) |
| NORETURN | ( | void | rb_async_bug_errnoconst char *, int | ) |
| NORETURN | ( | void | rb_load_failVALUE, const char * | ) |
| NORETURN | ( | void | rb_cmperrVALUE, VALUE | ) |
| NORETURN | ( | void | rb_invalid_strconst char *, const char * | ) |
| NORETURN | ( | void | rb_error_frozenconst char * | ) |
| NORETURN | ( | void | rb_error_arityint, int, int | ) |
| NORETURN | ( | void | rb_exc_raiseVALUE | ) |
| NORETURN | ( | void | rb_jump_tagint | ) |
| NORETURN | ( | void | rb_memerrorvoid | ) |
| NORETURN | ( | void | rb_insecure_operationvoid | ) |
| NORETURN | ( | void | rb_bug_errnoconst char *, int | ) |
| NORETURN | ( | void | rb_sys_failconst char * | ) |
| NORETURN | ( | void | rb_sys_fail_strVALUE | ) |
| NORETURN | ( | void | rb_mod_sys_failVALUE, const char * | ) |
| NORETURN | ( | void | rb_mod_sys_fail_strVALUE, VALUE | ) |
| NORETURN | ( | void | rb_exitint | ) |
| NORETURN | ( | void | rb_syserr_failint, const char * | ) |
| NORETURN | ( | void | rb_syserr_fail_strint, VALUE | ) |
| NORETURN | ( | void | rb_mod_syserr_failVALUE, int, const char * | ) |
| NORETURN | ( | void | rb_mod_syserr_fail_strVALUE, int, VALUE | ) |
| NORETURN | ( | void | rb_throwconst char *, VALUE | ) |
| ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_ | ( | (OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_ | ( | (OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[], OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_ | ( | (int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg) | ) |
| ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_ | ( | (int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[]) | ) |
| ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_ | ( | (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_ | ( | (const UChar *p, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_ | ( | (OnigCaseFoldType flag, const UChar **p, const UChar *end, UChar *lower, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_ | ( | (const UChar *p, const UChar *e, OnigEncoding enc) | ) |
| ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_ | ( | (const UChar *p, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_ | ( | (OnigCodePoint code, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_ | ( | (OnigCodePoint code, UChar *buf, OnigEncoding enc) | ) |
| ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_ | ( | (const UChar *start, const UChar *s, const OnigUChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_ | ( | (const UChar *s, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_ | ( | (const UChar *s, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_ascii_is_code_ctype P_ | ( | (OnigCodePoint code, unsigned int ctype, OnigEncoding enc) | ) |
| ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end) | ) |
| ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_ | ( | (OnigEncoding enc, OnigCaseFoldType flag, const UChar **p, const UChar *end, UChar *lower) | ) |
| ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_ | ( | (OnigCodePoint code, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_mb2_code_to_mbc P_ | ( | (OnigEncoding enc, OnigCodePoint code, UChar *buf) | ) |
| ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_ | ( | (OnigEncoding enc, UChar *p, UChar *end) | ) |
| ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_ | ( | (OnigEncoding enc, UChar *p, UChar *end) | ) |
| ONIG_EXTERN int onigenc_mb2_is_code_ctype P_ | ( | (OnigEncoding enc, OnigCodePoint code, unsigned int ctype) | ) |
| ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_ | ( | (OnigCodePoint code, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_mb4_code_to_mbc P_ | ( | (OnigEncoding enc, OnigCodePoint code, UChar *buf) | ) |
| ONIG_EXTERN int onigenc_mb4_is_code_ctype P_ | ( | (OnigEncoding enc, OnigCodePoint code, unsigned int ctype) | ) |
| ONIG_EXTERN int onigenc_unicode_is_code_ctype P_ | ( | (OnigCodePoint code, unsigned int ctype, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_ | ( | (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_unicode_ctype_code_range P_ | ( | (int ctype, const OnigCodePoint *ranges[]) | ) |
| ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_ | ( | (OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[]) | ) |
| ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_ | ( | (OnigEncoding enc, OnigCaseFoldType flag, const UChar **pp, const UChar *end, UChar *fold) | ) |
| ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_ | ( | (OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_with_ascii_strncmp P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n) | ) |
| ONIG_EXTERN int onigenc_with_ascii_strnicmp P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n) | ) |
| ONIG_EXTERN UChar* onigenc_step P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end, int n) | ) |
| int onig_is_in_code_range P_ | ( | (const UChar *p, OnigCodePoint code) | ) |
| ONIG_EXTERN int onigenc_mbclen_approximate P_ | ( | (const OnigUChar *p, const OnigUChar *e, struct OnigEncodingTypeST *enc) | ) |
| ONIG_EXTERN OnigUChar* onigenc_step_back P_ | ( | (OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end, int n) | ) |
| ONIG_EXTERN int onigenc_init P_ | ( | (void) | ) |
| ONIG_EXTERN int onigenc_set_default_encoding P_ | ( | (OnigEncoding enc) | ) |
| ONIG_EXTERN void onigenc_set_default_caseconv_table P_ | ( | (const OnigUChar *table) | ) |
| ONIG_EXTERN OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_ | ( | (OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end, const OnigUChar **prev) | ) |
| ONIG_EXTERN OnigUChar* onigenc_get_prev_char_head P_ | ( | (OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end) | ) |
| ONIG_EXTERN int onigenc_strlen P_ | ( | (OnigEncoding enc, const OnigUChar *p, const OnigUChar *end) | ) |
| ONIG_EXTERN int onigenc_strlen_null P_ | ( | (OnigEncoding enc, const OnigUChar *p) | ) |
| void onig_null_warn P_ | ( | (const char *s) | ) |
| ONIG_EXTERN void onig_set_warn_func P_ | ( | (OnigWarnFunc f) | ) |
| ONIG_EXTERN int onig_new P_ | ( | (OnigRegex *, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType *syntax, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN int onig_reg_init P_ | ( | (OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType *syntax) | ) |
| ONIG_EXTERN int onig_new_without_alloc P_ | ( | (OnigRegex, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType *syntax, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN int onig_new_deluxe P_ | ( | (OnigRegex *reg, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigCompileInfo *ci, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN void onig_free P_ | ( | (OnigRegex) | ) |
| ONIG_EXTERN int onig_recompile_deluxe P_ | ( | (OnigRegex reg, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigCompileInfo *ci, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN OnigPosition onig_search P_ | ( | (OnigRegex, const OnigUChar *str, const OnigUChar *end, const OnigUChar *start, const OnigUChar *range, OnigRegion *region, OnigOptionType option) | ) |
| ONIG_EXTERN OnigPosition onig_search_gpos P_ | ( | (OnigRegex, const OnigUChar *str, const OnigUChar *end, const OnigUChar *global_pos, const OnigUChar *start, const OnigUChar *range, OnigRegion *region, OnigOptionType option) | ) |
| ONIG_EXTERN OnigPosition onig_match P_ | ( | (OnigRegex, const OnigUChar *str, const OnigUChar *end, const OnigUChar *at, OnigRegion *region, OnigOptionType option) | ) |
| ONIG_EXTERN void onig_region_init P_ | ( | (OnigRegion *region) | ) |
| ONIG_EXTERN void onig_region_free P_ | ( | (OnigRegion *region, int free_self) | ) |
| ONIG_EXTERN void onig_region_copy P_ | ( | (OnigRegion *to, OnigRegion *from) | ) |
| ONIG_EXTERN int onig_region_resize P_ | ( | (OnigRegion *region, int n) | ) |
| ONIG_EXTERN int onig_region_set P_ | ( | (OnigRegion *region, int at, int beg, int end) | ) |
| ONIG_EXTERN int onig_name_to_group_numbers P_ | ( | (OnigRegex reg, const OnigUChar *name, const OnigUChar *name_end, int **nums) | ) |
| ONIG_EXTERN int onig_name_to_backref_number P_ | ( | (OnigRegex reg, const OnigUChar *name, const OnigUChar *name_end, OnigRegion *region) | ) |
| ONIG_EXTERN int onig_foreach_name P_ | ( | (OnigRegex reg, int(*func)(const OnigUChar *, const OnigUChar *, int, int *, OnigRegex, void *), void *arg) | ) |
| ONIG_EXTERN int onig_number_of_names P_ | ( | (OnigRegex reg) | ) |
| ONIG_EXTERN int onig_capture_tree_traverse P_ | ( | (OnigRegion *region, int at, int(*callback_func)(int, OnigPosition, OnigPosition, int, int, void *), void *arg) | ) |
| ONIG_EXTERN int onig_set_default_syntax P_ | ( | (const OnigSyntaxType *syntax) | ) |
| ONIG_EXTERN void onig_copy_syntax P_ | ( | (OnigSyntaxType *to, const OnigSyntaxType *from) | ) |
| ONIG_EXTERN unsigned int onig_get_syntax_op P_ | ( | (OnigSyntaxType *syntax) | ) |
| ONIG_EXTERN void onig_set_syntax_op P_ | ( | (OnigSyntaxType *syntax, unsigned int op) | ) |
| ONIG_EXTERN void onig_set_syntax_op2 P_ | ( | (OnigSyntaxType *syntax, unsigned int op2) | ) |
| ONIG_EXTERN void onig_set_syntax_behavior P_ | ( | (OnigSyntaxType *syntax, unsigned int behavior) | ) |
| ONIG_EXTERN void onig_set_syntax_options P_ | ( | (OnigSyntaxType *syntax, OnigOptionType options) | ) |
| ONIG_EXTERN int onig_set_meta_char P_ | ( | (OnigSyntaxType *syntax, unsigned int what, OnigCodePoint code) | ) |
| ONIG_EXTERN void onig_copy_encoding P_ | ( | (OnigEncoding to, OnigEncoding from) | ) |
| ONIG_EXTERN int onig_set_default_case_fold_flag P_ | ( | (OnigCaseFoldType case_fold_flag) | ) |
| ONIG_EXTERN int onig_set_match_stack_limit_size P_ | ( | (unsigned int size) | ) |
|
static |
| PRINTF_ARGS | ( | void | ruby_debug_printfconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | VALUE | rb_enc_sprintfrb_encoding *, const char *,..., |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char *,...)) | , |
| 3 | , | ||
| 4 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_loaderror(const char *,...)) | , |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_loaderror_with_path(VALUE path, const char *,...)) | , |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_name_error(ID, const char *,...)) | , |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_name_error_str(VALUE, const char *,...)) | , |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_errorconst char *, int, const char *,..., |
| 3 | , | ||
| 4 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_error_with_encconst char *, int, void *, const char *,..., |
| 4 | , | ||
| 5 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_error_appendconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | VALUE | rb_sprintfconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | VALUE | rb_str_catfVALUE, const char *,..., |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_warningconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_warningconst char *, int, const char *,..., |
| 3 | , | ||
| 4 | |||
| ) |
| PRINTF_ARGS | ( | int | ruby_snprintfchar *str, size_t n, char const *fmt,..., |
| 3 | , | ||
| 4 | |||
| ) |
| ONIG_EXTERN int onig_error_code_to_str PV_ | ( | (OnigUChar *s, OnigPosition err_code,...) | ) |
| void rb_add_event_hook | ( | rb_event_hook_func_t | func, |
| rb_event_flag_t | events, | ||
| VALUE | data | ||
| ) |
Definition at line 135 of file vm_trace.c.
References alloc_event_hook(), connect_event_hook(), GET_VM, and RUBY_EVENT_HOOK_FLAG_SAFE.
Definition at line 1175 of file vm_method.c.
References rb_method_entry_struct::def, rb_method_entry_struct::flag, cache_entry::klass, NIL_P, NOEX_UNDEF, rb_method_definition_struct::original_id, rb_cObject, rb_eTypeError, rb_frozen_class_p(), rb_method_entry_set(), rb_print_undef(), rb_raise(), rb_secure(), RB_TYPE_P, RCLASS_SUPER, search_method(), T_MODULE, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_ZSUPER.
Definition at line 858 of file variable.c.
References ALLOC, global_variable::block_trace, global_variable::counter, global_entry, trace_var::next, rb_eRuntimeError, rb_eSecurityError, rb_global_entry(), rb_raise(), rb_safe_level, st_add_direct(), st_lookup(), global_variable::trace, and xfree.
| void* rb_alloc_tmp_buffer | ( | volatile VALUE * | store, |
| long | len | ||
| ) |
Definition at line 814 of file string.c.
References rb_str_tmp_new(), and RSTRING_PTR.
Definition at line 384 of file object.c.
References CLASS_OF, OBJ_INFECT, PRIsVALUE, rb_class_name(), and rb_sprintf().
Calls a method.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| args | an Array object which contains method arguments |
Definition at line 745 of file vm_eval.c.
References ALLOCA_N, argc, argv, CALL_FCALL, MEMCPY, OBJ_FREEZE, RARRAY_LENINT, RARRAY_PTR, rb_ary_subseq(), rb_call(), RB_GC_GUARD, and RBASIC.
Definition at line 2747 of file object.c.
References NIL_P, rb_ary_new3(), rb_check_array_type(), rb_check_convert_type(), and T_ARRAY.
Definition at line 1163 of file array.c.
References arg, FIX2LONG, FIXNUM_P, NULL, NUM2LONG, Qfalse, Qnil, RARRAY_LEN, rb_ary_entry(), rb_ary_subseq(), rb_range_beg_len(), and rb_scan_args().
Referenced by Init_Array(), and match_aref().
Definition at line 3477 of file array.c.
References i, NIL_P, Qnil, RARRAY_LEN, RARRAY_PTR, rb_check_array_type(), rb_equal(), and v.
Referenced by Init_Array().
Definition at line 846 of file array.c.
References ary_ensure_room_for_push(), ARY_SET_LEN, MEMCPY, RARRAY_LEN, and RARRAY_PTR.
Referenced by enumerator_each(), features_index_add_single(), generator_each(), lazy_init_iterator(), and rb_ary_push_m().
Definition at line 3220 of file array.c.
References ary_sort_data::ary, ARY_CAPA, ARY_DEFAULT_SIZE, ARY_EMBED_P, ary_resize_capa(), ARY_SET_LEN, ARY_SHARED_P, FL_SET_EMBED, rb_ary_modify_check(), and rb_ary_unshare().
Referenced by coverage_result_i(), fdbm_delete_if(), fgdbm_delete_if(), Init_Array(), iseq_set_arguments(), method_missing(), open_key_args(), r_object0(), rb_io_s_popen(), rb_threadptr_pending_interrupt_clear(), ruby_set_argv(), and set_argv().
Definition at line 3724 of file array.c.
References INT2FIX, NIL_P, Qnil, Qundef, RARRAY_LEN, rb_check_array_type(), rb_exec_recursive_paired(), recursive_cmp(), and v.
Referenced by Init_Array().
Definition at line 3382 of file array.c.
References RARRAY_LEN, rb_ary_modify_check(), rb_ary_splice(), and to_ary().
Referenced by argf_readlines(), enum_sort_by(), flat_map_i(), hash2kv(), hash2kv_enc(), Init_Array(), ole_methods(), open_key_args(), rb_str_associate(), and sort_by_i().
Definition at line 2760 of file array.c.
References ary_resize_smaller(), Qnil, RARRAY_LEN, RARRAY_PTR, rb_ary_store(), rb_block_given_p(), rb_equal(), rb_yield(), and v.
Referenced by env_replace_i(), and Init_Array().
Definition at line 2813 of file array.c.
References ARY_INCREASE_LEN, MEMMOVE, Qnil, RARRAY_LEN, RARRAY_PTR, and rb_ary_modify().
Referenced by ary_reject_bang(), ole_delete_event(), rb_ary_delete_at_m(), rb_ary_slice_bang(), and rb_threadptr_pending_interrupt_deque().
Definition at line 2790 of file array.c.
References ary_resize_smaller(), RARRAY_LEN, RARRAY_PTR, and rb_ary_store().
Referenced by wmap_final_func().
Definition at line 1778 of file array.c.
References ARY_SET_LEN, MEMCPY, RARRAY_LEN, RARRAY_PTR, and rb_ary_new2().
Referenced by ary2sv(), coverage_result_i(), each_cons_i(), enumerator_each(), enumerator_peek_values_m(), iseq_build_from_ary_body(), method_def_location(), rb_ary_compact(), rb_ary_shuffle(), rb_ary_sort(), rb_ary_transpose(), rb_ary_uniq(), rb_io_s_popen(), rb_struct_s_members_m(), save_env_i(), and thread_create_core().
Definition at line 1670 of file array.c.
References i, RARRAY_LEN, RARRAY_PTR, rb_ary_length(), rb_yield(), and RETURN_SIZED_ENUMERATOR.
Referenced by dir_s_glob(), Init_Array(), and ossl_asn1cons_each().
Definition at line 1101 of file array.c.
References RARRAY_LEN, and rb_ary_elt().
Referenced by addrinfo_initialize(), addrinfo_ip_address(), addrinfo_ip_unpack(), addrinfo_mload(), ary2ptr_dispparams(), ary_len_of_dim(), ary_new_dim(), check_exec_redirect(), collect_caller_bindings(), dimension(), divmodv(), enc_register_at(), EVENTSINK_Invoke(), evs_entry(), foletypelib_initialize(), folevariant_initialize(), folevariant_s_array(), frame_get(), generate_json_array(), generate_json_object(), get_loaded_features_index(), hash2named_arg(), iseq_build_from_ary_body(), iseq_data_to_ary(), iseq_load(), JSON_parse_string(), lazy_zip_arrays_func(), lep_svar_get(), match_i(), ole_ary_m_entry(), ole_invoke(), ole_invoke2(), ole_search_event(), ole_search_event_at(), oletypelib_search_registry2(), ossl_asn1cons_to_der(), ossl_call_client_cert_cb(), ossl_call_session_get_cb(), ossl_call_session_new_cb(), ossl_call_session_remove_cb(), ossl_sslctx_set_ciphers(), ossl_x509name_init_i(), path_split(), pty_close_pty(), rb_ary_aref(), rb_ary_at(), rb_ary_bsearch(), rb_ary_product(), rb_ary_values_at(), rb_debug_inspector_frame_binding_get(), rb_debug_inspector_frame_class_get(), rb_debug_inspector_frame_iseq_get(), rb_debug_inspector_frame_self_get(), rb_econv_init_by_convpath(), rb_enc_aliases_enc_i(), rb_enc_from_encoding_index(), rb_execarg_addopt(), rb_iseq_build_from_ary(), rb_iseq_disasm(), rb_reg_s_union(), rb_reg_s_union_m(), rb_struct_each_pair(), rb_struct_to_h(), rescue_callback(), select_internal(), set_state_ivars(), start_document(), time_timespec(), and wdivmod().
| void rb_ary_free | ( | VALUE | ) |
Definition at line 471 of file array.c.
References ARY_HEAP_PTR, ARY_OWNS_HEAP_P, and xfree.
Referenced by ary_discard(), obj_free(), rb_ary_decrement_share(), and ruby_vm_run_at_exit_hooks().
Definition at line 330 of file array.c.
References rb_obj_freeze().
Referenced by coverage_result_i(), curry(), make_curry_proc(), and rb_add_method().
Definition at line 3666 of file array.c.
References i, Qfalse, Qtrue, RARRAY_LEN, RARRAY_PTR, and rb_equal().
Referenced by env_replace_i(), and Init_Array().
Definition at line 1886 of file array.c.
References ary_join_0(), ary_join_1(), FALSE, i, NIL_P, OBJ_TAINT, OBJ_TAINTED, OBJ_UNTRUST, OBJ_UNTRUSTED, RARRAY_LEN, RARRAY_PTR, rb_check_string_type(), rb_enc_associate(), rb_str_buf_new(), rb_usascii_encoding(), rb_usascii_str_new(), result, RSTRING_LEN, StringValue, TRUE, and val.
Referenced by insn_operand_intern(), pipe_open(), rb_ary_join_m(), rb_ary_times(), rb_spawn_process(), and tcl_protect_core().
Definition at line 1258 of file array.c.
References ary_take_first_or_last(), ARY_TAKE_LAST, Qnil, RARRAY_LEN, and RARRAY_PTR.
Referenced by Init_Array(), and range_last().
| void rb_ary_modify | ( | VALUE | ) |
Definition at line 254 of file array.c.
References ALLOC_N, ARY_EMBED_PTR, ARY_HEAP_PTR, ARY_SET_CAPA, ARY_SET_EMBED_LEN, ARY_SET_PTR, ARY_SHARED, ARY_SHARED_NUM, ARY_SHARED_P, FL_SET_EMBED, FL_UNSET_SHARED, MEMCPY, MEMMOVE, RARRAY_EMBED_LEN_MAX, RARRAY_LEN, RARRAY_PTR, rb_ary_decrement_share(), rb_ary_modify_check(), rb_ary_unshare(), and shift().
Referenced by ary_ensure_room_for_push(), ary_ensure_room_for_unshift(), ary_resize_smaller(), rb_ary_collect_bang(), rb_ary_compact_bang(), rb_ary_delete_at(), rb_ary_fill(), rb_ary_initialize(), rb_ary_resize(), rb_ary_reverse(), rb_ary_rotate(), rb_ary_select_bang(), rb_ary_shuffle_bang(), rb_ary_sort_bang(), rb_ary_sort_by_bang(), rb_ary_splice(), and rb_ary_store().
| VALUE rb_ary_new | ( | void | ) |
Definition at line 424 of file array.c.
References RARRAY_EMBED_LEN_MAX, and rb_ary_new2().
Referenced by add_event_call_back(), add_modules(), addrinfo_list_new(), argf_readlines(), ary_new_dim(), backtrace_collect(), cbsubst_get_extra_args_tbl(), cbsubst_table_setup(), check_exec_redirect1(), class_instance_method_list(), collect_caller_bindings(), debug_lines(), dir_globs(), econv_convpath(), enum_collect(), enum_cycle(), enum_drop(), enum_drop_while(), enum_find_all(), enum_flat_map(), enum_grep(), enum_partition(), enum_reject(), enum_sort_by(), enum_take_while(), enum_to_a(), enum_zip(), env_each_pair(), env_keys(), env_to_a(), env_values(), env_values_at(), EVENTSINK_Invoke(), fdbm_keys(), fdbm_select(), fdbm_to_a(), fdbm_values(), fev_initialize(), fgdbm_keys(), fgdbm_select(), fgdbm_to_a(), fgdbm_values(), filename_completion_proc_call(), foletype_s_progids(), foletypelib_ole_types(), foletypelib_s_typelibs(), fsdbm_delete_if(), fsdbm_keys(), fsdbm_select(), fsdbm_to_a(), fsdbm_values(), gc_profile_record_get(), Init_load(), Init_ossl_asn1(), Init_VM(), Init_win32ole(), insn_operand_intern(), int_ossl_asn1_decode0_cons(), iseq_data_to_ary(), JSON_parse_array(), lep_svar_set(), make_addrinfo(), make_hostent_internal(), nsdr(), ole_method_params(), ole_method_return_type_detail(), ole_methods(), ole_methods_from_typeinfo(), ole_param_ole_type_detail(), ole_type_impl_ole_types(), ole_variable_ole_type_detail(), ole_variables(), ole_variant2val(), ossl_asn1_decode0(), ossl_asn1_decode_all(), ossl_get_errors(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_sslctx_get_ciphers(), ossl_x509_get_extensions(), ossl_x509crl_get_extensions(), ossl_x509crl_get_revoked(), ossl_x509name_to_a(), ossl_x509req_get_attributes(), ossl_x509revoked_get_extensions(), ossl_x509stctx_get_chain(), pack_pack(), pack_unpack(), parse(), prepare_iseq_build(), proc_curry(), proc_waitall(), rb_ary_diff(), rb_ary_drop(), rb_ary_reject(), rb_call_end_proc(), rb_check_exec_env(), rb_enc_aliases(), rb_execarg_addopt(), rb_f_global_variables(), rb_f_local_variables(), rb_f_untrace_var(), rb_fiddle_ptr_free_get(), rb_gzreader_readlines(), rb_hash_keys(), rb_hash_to_a(), rb_hash_values(), rb_insns_name_array(), rb_io_readlines(), rb_iseq_disasm(), rb_iseq_line_trace_all(), rb_mod_ancestors(), rb_mod_included_modules(), rb_mod_nesting(), rb_obj_instance_variables(), rb_obj_singleton_methods(), rb_push_glob(), rb_reg_names(), rb_scan_args(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_scan(), rb_str_split_m(), rb_struct_define(), rb_struct_select(), rb_thread_keys(), rb_thread_list(), rb_thread_variables(), reachable_objects_from(), reduce0(), save_env(), save_redirect_fd(), search_convpath_i(), select_internal(), sock_s_gethostbyaddr(), strio_readlines(), thgroup_list(), tk_hash_kv(), username_completion_proc_call(), vm_backtrace_to_ary(), vm_expandarray(), and vm_yield_setup_block_args().
| VALUE rb_ary_new2 | ( | long | ) |
Definition at line 417 of file array.c.
References ary_new(), and rb_cArray.
Referenced by ary2list(), ary2list2(), ary_make_substitution(), assoc2kv(), assoc2kv_enc(), BigDecimal_split(), cbsubst_scan_args(), collect_caller_bindings_cfunc(), collect_caller_bindings_iseq(), coverage(), cvar_list(), each_slice_i(), econv_primitive_errinfo(), enc_list(), enc_names(), enum_each_cons(), enum_each_slice(), enum_sort_by(), enum_take(), fdbm_values_at(), fgdbm_values_at(), fsdbm_values_at(), generator_each(), hash2kv(), hash2kv_enc(), Init_Encoding(), Init_ossl_ssl(), Init_tcltklib(), ip_ruby_cmd(), iseq_data_to_ary(), JSON_parse_string(), lazy_zip(), lazy_zip_arrays_func(), lazy_zip_func(), lib_split_tklist_core(), make_hostent_internal(), match_array(), mk_ary_of_str(), nil_to_a(), ossl_generate_cb(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_ssl_cipher_to_ary(), ossl_ssl_get_peer_cert_chain(), ossl_sslctx_get_ciphers(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_x509_get_extensions(), ossl_x509crl_get_extensions(), ossl_x509crl_get_revoked(), ossl_x509name_to_a(), ossl_x509req_get_attributes(), ossl_x509revoked_get_extensions(), ossl_x509stctx_get_chain(), permute0(), pty_getpty(), r_object0(), random_dump(), range_first(), rb_ary_and(), rb_ary_collect(), rb_ary_combination(), rb_ary_dup(), rb_ary_new(), rb_ary_new3(), rb_ary_new4(), rb_ary_or(), rb_ary_permutation(), rb_ary_plus(), rb_ary_product(), rb_ary_repeated_combination(), rb_ary_repeated_permutation(), rb_ary_reverse_m(), rb_ary_rotate_m(), rb_ary_sample(), rb_ary_select(), rb_ary_slice_bang(), rb_ary_to_a(), rb_ary_transpose(), rb_ary_zip(), rb_const_list(), rb_enc_name_list(), rb_get_values_at(), rb_hash_values_at(), rb_iseq_parameters(), rb_str_enumerate_bytes(), rb_str_split_m(), rb_struct_define_without_accessor(), rb_sym_all_symbols(), rb_zlib_crc_table(), rcombinate0(), reg_named_captures_iter(), rpermute0(), scan_once(), select_internal(), take_items(), tk_conv_args(), unnamed_parameters(), zip_ary(), and zip_i().
| VALUE rb_ary_new3 | ( | long | , |
| ... | |||
| ) |
Definition at line 432 of file array.c.
References ARY_SET_LEN, i, RARRAY_PTR, and rb_ary_new2().
Referenced by addrinfo_mdump(), bmcall(), cbsubst_get_all_subst_keys(), check_exec_redirect(), chunk_ii(), d_lite_marshal_dump(), define_final0(), enum_minmax(), ev_on_event(), get_eventloop_weight(), group_by_i(), hash2kv(), hash2kv_enc(), ip_eval(), ip_invoke_with_position(), lazy_drop(), lazy_grep(), lazy_take(), lib_getversion(), make_curry_proc(), ossl_x509name_initialize(), ossl_x509name_to_a(), parse(), path_split(), rb_add_method(), rb_Array(), rb_ary_combination(), rb_ary_permutation(), rb_ary_repeated_combination(), rb_ary_repeated_permutation(), rb_ary_sample(), rb_ary_to_ary(), rb_assoc_new(), rb_check_backtrace(), rb_execarg_addopt(), rb_f_untrace_var(), rb_str_partition(), rb_str_rpartition(), rb_str_split_m(), rb_trace_eval(), rsock_ipaddr(), rt_complete_frags(), run_finalizer(), set_eventloop_weight(), setup_exception(), signal_exec(), slicebefore_ii(), time_to_a(), tk_funcall(), unnamed_parameters(), and yyparse().
Definition at line 451 of file array.c.
References ARY_SET_LEN, MEMCPY, RARRAY_PTR, and rb_ary_new2().
Referenced by call_cfunc_m2(), check_funcall_exec(), curry(), enum_zip(), enumerator_each(), enumerator_init(), enumerator_with_index_i(), enumerator_with_object_i(), get_stack_tail(), iseq_location(), lazy_zip(), libyaml_version(), make_no_method_exception(), make_passing_arg(), next_ii(), pipe_open(), proc_fallback(), rb_ary_combination(), rb_ary_insert(), rb_ary_resurrect(), rb_ary_sample(), rb_ary_slice_bang(), rb_enum_values_pack(), rb_f_p_internal(), rb_mod_module_exec(), rb_obj_instance_exec(), rb_scan_args(), rb_spawn_process(), rb_struct_to_a(), take_i(), vm_call0_body(), vm_callee_setup_arg_complex(), vm_expandarray(), vm_yield_setup_block_args(), vm_yield_setup_block_args_complex(), and vm_yield_with_cfunc().
Definition at line 3353 of file array.c.
References ARY_SET_LEN, MEMCPY, RARRAY_LEN, RARRAY_PTR, rb_ary_new2(), and to_ary().
Referenced by assoc2kv(), assoc2kv_enc(), curry(), Init_Array(), and tk_conv_args().
Definition at line 879 of file array.c.
References ARY_CAPA, ARY_DEFAULT_SIZE, ARY_OWNS_HEAP_P, ary_resize_capa(), ARY_SET_LEN, Qnil, RARRAY_LEN, RARRAY_PTR, and rb_ary_modify_check().
Referenced by cut_stack_tail(), flatten(), lib_eventloop_ensure(), r_object0(), rb_ary_pop_m(), rb_str_split_m(), rb_thread_s_handle_interrupt(), rb_uninterruptible(), and ruby_vm_run_at_exit_hooks().
Definition at line 822 of file array.c.
References ary_ensure_room_for_push(), ARY_SET_LEN, RARRAY_LEN, and RARRAY_PTR.
Referenced by add_event_call_back(), add_modules(), addrinfo_list_new(), ary2list(), ary2list2(), assoc2kv(), assoc2kv_enc(), backtrace_collect(), BigDecimal_split(), callback(), cbsubst_scan_args(), cdhash_each(), check_exec_env_i(), check_exec_redirect1(), chunk_ii(), collect_all(), collect_caller_bindings_cfunc(), collect_caller_bindings_iseq(), collect_i(), collect_local_variables_in_iseq(), collect_trace(), collect_values(), compile_array_(), cv_list_i(), cycle_i(), define_final0(), drop_i(), drop_while_i(), each_cons_i(), each_slice_i(), econv_convpath(), enc_names_i(), env_each_pair(), env_keys(), env_to_a(), env_values(), env_values_at(), EVENTSINK_Invoke(), evs_push(), fdbm_delete_if(), fdbm_keys(), fdbm_select(), fdbm_to_a(), fdbm_values(), fdbm_values_at(), features_index_add_single(), fgdbm_delete_if(), fgdbm_keys(), fgdbm_select(), fgdbm_to_a(), fgdbm_values(), fgdbm_values_at(), filename_completion_proc_call(), find_all_i(), first_i(), flat_map_i(), flatten(), foletype_s_progids(), foletypelib_s_typelibs(), fsdbm_delete_if(), fsdbm_keys(), fsdbm_select(), fsdbm_to_a(), fsdbm_values(), fsdbm_values_at(), gc_profile_record_get(), generator_each(), grep_i(), grep_iter_i(), group_by_i(), gvar_i(), Init_Array(), Init_Encoding(), Init_ossl_ssl(), Init_VM(), ins_methods_push(), insn_operand_intern(), int_ossl_asn1_decode0_cons(), ip_ruby_cmd(), iseq_add_mark_object(), iseq_add_mark_object_compile_time(), iseq_data_to_ary(), iseq_set_arguments(), ivar_i(), JSON_parse_array(), JSON_parse_string(), keys_i(), lazy_init_iterator(), lazy_zip(), lazy_zip_arrays_func(), lazy_zip_func(), lex_getline(), lib_eventloop_launcher(), lib_split_tklist_core(), list_i(), make_addrinfo(), make_hostent_internal(), match_array(), match_i(), mk_ary_of_str(), nsdr(), ole_method_params(), ole_methods_sub(), ole_type_impl_ole_types(), ole_typedesc2val(), ole_types_from_typelib(), ole_usertype2val(), ole_variables(), open_key_args(), ossl_asn1_decode0(), ossl_asn1_decode_all(), ossl_get_errors(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_ssl_cipher_to_ary(), ossl_ssl_get_peer_cert_chain(), ossl_sslctx_get_ciphers(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_x509_get_extensions(), ossl_x509crl_get_extensions(), ossl_x509crl_get_revoked(), ossl_x509name_to_a(), ossl_x509req_get_attributes(), ossl_x509revoked_get_extensions(), ossl_x509stctx_get_chain(), pack_pack(), parse(), partition_i(), proc_waitall(), push_include(), push_kv(), push_kv_enc(), push_pattern(), push_value(), r_object0(), random_dump(), rb_ary_and(), rb_ary_collect(), rb_ary_diff(), rb_ary_or(), rb_ary_product(), rb_ary_select(), rb_ary_uniq(), rb_ary_zip(), rb_construct_expanded_load_path(), rb_enc_name_list_i(), rb_execarg_addopt(), rb_f_global_variables(), rb_f_local_variables(), rb_f_untrace_var(), rb_fiddle_ptr_free_get(), rb_gc_register_mark_object(), rb_get_values_at(), rb_gzreader_readlines(), rb_hash_values_at(), rb_insns_name_array(), rb_io_readlines(), rb_iseq_parameters(), rb_mod_ancestors(), rb_mod_included_modules(), rb_mod_nesting(), rb_provide_feature(), rb_require_safe(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_scan(), rb_str_split_m(), rb_struct_define(), rb_struct_define_without_accessor(), rb_struct_select(), rb_thread_s_handle_interrupt(), rb_threadptr_pending_interrupt_enque(), rb_uninterruptible(), rb_zlib_crc_table(), reachable_object_from_i(), reg_names_iter(), reject_i(), ruby_init_loadpath_safe(), ruby_set_argv(), ruby_vm_at_exit(), save_env_i(), save_redirect_fd(), scan_once(), select_internal(), set_argv(), slicebefore_ii(), sock_s_gethostbyaddr(), strio_readlines(), symbols_i(), take_i(), take_while_i(), thgroup_list_i(), thread_keys_i(), thread_list_i(), tk_conv_args(), to_a_i(), unnamed_parameters(), username_completion_proc_call(), values_i(), waitall_each(), wmap_aset(), yycompile0(), yyparse(), zip_ary(), and zip_i().
Definition at line 3510 of file array.c.
References i, Qnil, RARRAY_LEN, RARRAY_PTR, rb_equal(), RB_TYPE_P, T_ARRAY, and v.
Referenced by Init_Array().
Definition at line 3168 of file array.c.
References ary_make_shared(), ARY_OWNS_HEAP_P, ARY_SET_LEN, ARY_SET_PTR, ARY_SHARED, ARY_SHARED_P, FL_SET_EMBED, FL_UNSET_EMBED, FL_UNSET_SHARED, MEMCPY, RARRAY_EMBED_LEN_MAX, RARRAY_LEN, RARRAY_PTR, rb_ary_decrement_share(), rb_ary_modify_check(), rb_ary_set_shared(), rb_ary_unshare_safe(), to_ary(), and xfree.
Referenced by enc_list(), Init_Array(), rb_ary_flatten_bang(), rb_ary_initialize(), rb_ary_sort_by_bang(), rb_ary_to_a(), rb_construct_expanded_load_path(), and reset_loaded_features_snapshot().
expands or shrinks ary to len elements.
expanded region will be filled with Qnil.
| ary | an array |
| len | new size |
Definition at line 1513 of file array.c.
References ARY_CAPA, ARY_DEFAULT_SIZE, ary_discard(), ary_double_capa(), ARY_EMBED_P, ARY_EMBED_PTR, ARY_HEAP_PTR, ARY_MAX_SIZE, ARY_SET_CAPA, ARY_SET_EMBED_LEN, ARY_SET_HEAP_LEN, ARY_SET_LEN, MEMCPY, RARRAY, RARRAY_EMBED_LEN_MAX, RARRAY_LEN, RARRAY_PTR, rb_ary_modify(), rb_eIndexError, rb_mem_clear(), rb_raise(), and REALLOC_N.
Referenced by enum_sort_by(), rb_get_values_at(), and wmap_free_map().
Definition at line 1787 of file array.c.
References RARRAY_LEN, RARRAY_PTR, and rb_ary_new4().
Referenced by obj_resurrect().
Definition at line 2043 of file array.c.
References ary_reverse(), RARRAY_LEN, RARRAY_PTR, and rb_ary_modify().
Referenced by collect_caller_bindings(), and rb_ary_reverse_bang().
Definition at line 2105 of file array.c.
References ary_reverse(), Qnil, RARRAY_LEN, RARRAY_PTR, rb_ary_modify(), and rotate_count().
Referenced by rb_ary_rotate_bang().
| void rb_ary_set_len | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1490 of file array.c.
References ARY_CAPA, ARY_SET_LEN, ARY_SHARED_P, rb_ary_modify_check(), rb_bug(), rb_eRuntimeError, and rb_raise().
Referenced by method_missing().
Definition at line 358 of file array.c.
References ARY_EMBED_P, ARY_SHARED_P, Qfalse, Qtrue, and RARRAY.
Referenced by get_loaded_features_index(), and rb_get_expanded_load_path().
Definition at line 929 of file array.c.
References ARY_DEFAULT_SIZE, ARY_EMBED_P, ARY_INCREASE_LEN, ARY_INCREASE_PTR, ary_make_shared(), ARY_SHARED, ARY_SHARED_NUM, ARY_SHARED_P, assert, MEMMOVE, Qnil, RARRAY_LEN, RARRAY_PTR, rb_ary_modify_check(), and top.
Referenced by argf_next_argv(), each_cons_i(), filename_completion_proc_call(), process_sflag(), rb_ary_shift_m(), rb_threadptr_pending_interrupt_deque(), require_libraries(), and username_completion_proc_call().
Definition at line 2373 of file array.c.
References ary_sort_data::ary, rb_ary_dup(), and rb_ary_sort_bang().
Referenced by enum_sort(), and Init_Array().
Definition at line 2290 of file array.c.
References ary_sort_data::ary, ARY_EMBED_LEN, ARY_EMBED_P, ARY_EMBED_PTR, ARY_HEAP_PTR, ary_make_substitution(), ARY_SET_CAPA, ARY_SET_EMBED_LEN, ARY_SET_HEAP_LEN, ARY_SET_LEN, ARY_SET_PTR, ARY_SHARED_P, assert, FL_FREEZE, FL_SET, FL_SET_EMBED, FL_UNSET, FL_UNSET_EMBED, FL_UNSET_SHARED, MEMCPY, ary_sort_data::opt_inited, ary_sort_data::opt_methods, RARRAY_LEN, RARRAY_PTR, rb_ary_modify(), rb_ary_unshare(), rb_block_given_p(), rb_cArray, RBASIC, ruby_qsort(), sort_1(), sort_2(), and xfree.
Referenced by Init_Array(), and rb_ary_sort().
Definition at line 719 of file array.c.
References ARY_CAPA, ary_double_capa(), ARY_MAX_SIZE, ARY_SET_LEN, RARRAY_LEN, RARRAY_PTR, rb_ary_modify(), rb_eIndexError, rb_mem_clear(), and rb_raise().
Referenced by addrinfo_ip_unpack(), ary_new_dim(), ary_store_dim(), check_exec_fds(), collect_caller_bindings(), collect_caller_bindings_cfunc(), collect_caller_bindings_iseq(), decorate_convpath(), econv_primitive_errinfo(), enc_register_at(), enum_minmax(), enum_sort_by(), evs_delete(), get_loaded_features_index(), Init_ossl_asn1(), iseq_build_from_ary_body(), iseq_data_to_ary(), lep_svar_set(), ossl_generate_cb(), path_entries(), path_s_glob(), pty_getpty(), rb_ary_aset(), rb_ary_collect_bang(), rb_ary_delete(), rb_ary_delete_same(), rb_ary_initialize(), rb_ary_select_bang(), rb_ary_transpose(), rb_ary_uniq_bang(), rb_enc_aliases_enc_i(), reg_named_captures_iter(), search_convpath_i(), sym_to_proc(), unnamed_parameters(), zip_ary(), and zip_i().
Definition at line 1110 of file array.c.
References ary_make_partial(), ary_new(), Qnil, RARRAY_LEN, and rb_obj_class().
Referenced by rb_apply(), rb_ary_aref(), rb_ary_drop(), rb_ary_take(), and take_items().
| VALUE rb_ary_tmp_new | ( | long | ) |
Definition at line 465 of file array.c.
References ary_new().
Referenced by callback(), compile_array_(), enum_sort_by(), fdbm_delete_if(), features_index_add_single(), fgdbm_delete_if(), Init_load(), Init_Thread(), Init_top_self(), iseq_set_arguments(), lazy_init_iterator(), method_missing(), open_key_args(), prepare_iseq_build(), r_object0(), rb_construct_expanded_load_path(), rb_iseq_build_for_ruby2cext(), rb_struct_new(), sym_to_proc(), thread_create_core(), and wmap_aset().
Definition at line 1425 of file array.c.
References NIL_P, rb_ary_new3(), and rb_check_array_type().
Referenced by rb_ary_splice(), and vm_expandarray().
Definition at line 1994 of file array.c.
References rb_ary_inspect().
Definition at line 1084 of file array.c.
References rb_ary_unshift_m().
Referenced by check_funcall_exec(), ole_invoke(), parser_set_encode(), rb_struct_s_def(), and vm_call0_body().
| int rb_ascii8bit_encindex | ( | void | ) |
Definition at line 1160 of file encoding.c.
References ENCINDEX_ASCII.
Referenced by enc_set_filesystem_encoding(), pack_unpack(), parser_regx_options(), rb_char_to_option_kcode(), rb_filesystem_encindex(), rb_locale_encindex(), and transcode_io().
| rb_encoding* rb_ascii8bit_encoding | ( | void | ) |
Definition at line 1151 of file encoding.c.
References enc_table, ENCINDEX_ASCII, and rb_enc_init().
Referenced by code_page(), do_opendir(), do_writeconv(), file_path_convert(), int_chr(), load_file_internal(), make_writeconv(), parser_str_new(), rb_define_dummy_encoding(), rb_encdb_dummy(), rb_external_str_new_with_enc(), rb_file_open_internal(), rb_glob(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_io_ascii8bit_binmode(), rb_io_ext_int_to_encs(), rb_io_extract_modeenc(), rb_reg_initialize(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_new(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_s_union(), rb_str_concat(), rb_str_dump(), rb_str_encode_ospath(), rb_strftime_with_timespec(), rb_symname_p(), rb_w32_conv_from_wchar(), rb_w32_readdir(), reg_fragment_setenc_gen(), RUBY_ALIAS_FUNCTION(), ruby_brace_glob(), ruby_glob(), strio_read(), strio_ungetc(), and strio_write().
Definition at line 545 of file array.c.
References rb_ary_new3().
Referenced by addrinfo_getnameinfo(), addrinfo_mdump(), assoc_i(), BigDecimal_coerce(), BigDecimal_divmod(), BigDecimal_prec(), check_exec_env_i(), check_exec_redirect1(), chunk_i(), chunk_ii(), each_pair_i(), econv_convpath(), enum_minmax_by(), enum_partition(), env_assoc(), env_each_pair(), env_rassoc(), env_shift(), env_to_a(), fdbm_delete_if(), fdbm_each_pair(), fdbm_select(), fdbm_shift(), fdbm_to_a(), fgdbm_delete_if(), fgdbm_each_pair(), fgdbm_select(), fgdbm_shift(), fgdbm_to_a(), fix_divmod(), flo_coerce(), flo_divmod(), fsdbm_delete_if(), fsdbm_each_pair(), fsdbm_select(), fsdbm_shift(), fsdbm_to_a(), match_offset(), math_frexp(), math_lgamma(), nucomp_coerce(), nucomp_marshal_dump(), nucomp_polar(), nucomp_rect(), num_coerce(), num_divmod(), numeric_polar(), numeric_rect(), nurat_coerce(), nurat_marshal_dump(), ossl_bn_coerce(), proc_wait2(), proc_waitall(), pty_open(), rassoc_i(), rb_big_coerce(), rb_big_divmod(), rb_file_s_split(), rb_gcdlcm(), rb_hash_shift(), rb_io_s_pipe(), rb_struct_each_pair(), rsock_s_recvfrom(), rsock_s_recvfrom_nonblock(), save_redirect_fd(), search_convpath_i(), sock_accept(), sock_accept_nonblock(), sock_s_getnameinfo(), sock_s_unpack_sockaddr_in(), sock_sysaccept(), sockopt_linger(), to_a_i(), waitall_each(), and yyparse().
Definition at line 791 of file vm_method.c.
References name, NOEX_MODFUNC, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_PUBLIC, rb_add_method(), rb_eArgError, rb_enc_copy(), rb_id2name(), rb_id2str(), rb_id_attrset(), rb_intern_str, rb_is_const_id(), rb_is_local_id(), rb_name_error(), rb_raise(), rb_sprintf(), rb_warning(), SCOPE_CHECK, SCOPE_TEST, VM_METHOD_TYPE_ATTRSET, and VM_METHOD_TYPE_IVAR.
Definition at line 1117 of file variable.c.
References FALSE, and ivar_get().
Definition at line 1599 of file variable.c.
References ALLOC, autoload, check_autoload_table, DATA_PTR, autoload_data_i::feature, FL_TAINT, FL_UNSET, OBJ_FREEZE, PRIsVALUE, Qnil, Qundef, QUOTE_ID, rb_const_set(), rb_eArgError, rb_eNameError, rb_is_const_id(), rb_raise(), rb_safe_level, rb_str_new2, RCLASS_CONST_TBL, RCLASS_IV_TBL, autoload_data_i::safe_level, st_add_direct(), st_init_numtable(), st_insert(), st_lookup(), autoload_data_i::thread, TypedData_Wrap_Struct, and autoload_data_i::value.
Definition at line 1760 of file variable.c.
References args, autoload_const_set(), autoload_defined_p(), autoload_require(), check_autoload_data, check_autoload_required(), id, autoload_const_set_args::id, mod, autoload_const_set_args::mod, Qfalse, Qnil, Qundef, rb_ensure(), RB_GC_GUARD, rb_jump_tag(), rb_protect(), rb_safe_level, rb_set_safe_level_force(), rb_sourcefile, rb_thread_current(), reset_safe(), result, RTEST, autoload_data_i::thread, and autoload_const_set_args::value.
Definition at line 1805 of file variable.c.
References autoload_defined_p(), check_autoload_data, check_autoload_required(), autoload_data_i::feature, Qnil, and RCLASS_SUPER.
|
static |
| VALUE rb_backref_get | ( | void | ) |
Definition at line 762 of file vm.c.
References vm_svar_get().
| void rb_backref_set | ( | VALUE | ) |
Definition at line 768 of file vm.c.
References vm_svar_set().
| void rb_backtrace | ( | void | ) |
Definition at line 766 of file vm_backtrace.c.
References vm_backtrace_print().
| int rb_backtrace_p | ( | VALUE | obj | ) |
Definition at line 413 of file vm_backtrace.c.
References rb_typeddata_is_kind_of().
| void rb_backtrace_print_as_bugreport | ( | void | ) |
Definition at line 750 of file vm_backtrace.c.
References backtrace_each(), oldbt_arg::data, oldbt_arg::func, GET_THREAD(), i, oldbt_bugreport(), oldbt_init(), oldbt_iter_cfunc(), and oldbt_iter_iseq().
Definition at line 586 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace_size, backtrace_to_str_ary(), bt_iter_arg::bt, GetCoreDataFromValue, and rb_backtrace_struct::strary.
| double rb_big2dbl | ( | VALUE | ) |
Definition at line 1429 of file bignum.c.
References big2dbl(), isinf(), and rb_warning().
Referenced by flo_div(), flo_divmod(), flo_minus(), flo_mod(), flo_mul(), flo_plus(), flo_pow(), int_pair_to_real_inclusive(), ole_val2ptr_variant(), ole_val2variant(), rb_big_divide(), rb_big_fdiv(), rb_big_minus(), rb_big_mul(), rb_big_plus(), rb_big_pow(), rb_big_to_f(), and rb_Float().
| SIGNED_VALUE rb_big2long | ( | VALUE | ) |
Definition at line 1243 of file bignum.c.
References big2ulong(), LONG_MAX, LONG_MIN, rb_eRangeError, rb_raise(), RBIGNUM_POSITIVE_P, and TRUE.
Referenced by rb_num2long().
Definition at line 1159 of file bignum.c.
References rb_big2str0().
Referenced by GetVpValueWithPrec(), rb_big_to_s(), and rb_str_format().
Definition at line 1113 of file bignum.c.
References big2str_find_n1(), big2str_karatsuba(), big2str_orig(), BIGZEROP, FIXNUM_P, KARATSUBA_DIGITS, rb_big_clone(), rb_big_resize(), rb_eArgError, rb_fix2str(), rb_raise(), rb_str_resize(), rb_usascii_str_new(), rb_usascii_str_new2, RBIGNUM_SET_SIGN, RBIGNUM_SIGN, and RSTRING_PTR.
Referenced by rb_big2str(), and rb_str_format().
Definition at line 1225 of file bignum.c.
References big2ulong(), LONG_MAX, LONG_MIN, rb_eRangeError, rb_raise(), RBIGNUM_POSITIVE_P, and TRUE.
Referenced by rb_gzfile_set_mtime(), rb_num2ulong(), and rb_num_to_uint().
Definition at line 1215 of file bignum.c.
References big2ulong(), FALSE, RBIGNUM_SIGN, and SIGNED_VALUE.
Referenced by rb_dlcfunc_call().
| void rb_big_2comp | ( | VALUE | ) |
Definition at line 3279 of file bignum.c.
References BDIGIT, BDIGITS, bigand_int(), bignew, bignorm(), FIX2LONG, FIXNUM_P, get2comp(), i, rb_big_clone(), rb_num_coerce_bit(), RB_TYPE_P, RBIGNUM_LEN, RBIGNUM_SIGN, T_BIGNUM, and big_div_struct::zds.
Referenced by fix_and(), and Init_Bignum().
Definition at line 192 of file bignum.c.
References BDIGIT, BDIGITS, bignew_1(), CLASS_OF, MEMCPY, RBIGNUM_LEN, and RBIGNUM_SIGN.
Referenced by big_rshift(), bigdivrem(), limited_big_rand(), rand_int(), rb_big2str0(), rb_big_abs(), rb_big_and(), rb_big_neg(), rb_big_or(), rb_big_uminus(), rb_big_xor(), and rb_str_format().
Definition at line 1553 of file bignum.c.
References BDIGIT, BDIGITS, FIX2LONG, INT2FIX, rb_int2big(), rb_integer_float_cmp(), rb_intern, rb_num_coerce_cmp(), RBIGNUM_LEN, RBIGNUM_SIGN, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by big_op(), fix_cmp(), fix_ge(), fix_gt(), fix_le(), fix_lt(), Init_Bignum(), and rb_integer_float_cmp().
Definition at line 2924 of file bignum.c.
References rb_big_divide().
Referenced by fix_divide(), and Init_Bignum().
Definition at line 3010 of file bignum.c.
References bigdivmod(), bignorm(), div, FIX2LONG, mod, rb_assoc_new(), rb_int2big(), rb_intern, rb_num_coerce_bin(), T_BIGNUM, T_FIXNUM, and TYPE.
Referenced by fix_divmod(), Init_Bignum(), and pack_pack().
Definition at line 1706 of file bignum.c.
References BDIGIT, BDIGITS, FIX2LONG, MEMCMP, Qfalse, Qtrue, rb_equal(), rb_int2big(), rb_integer_float_eq(), RBIGNUM_LEN, RBIGNUM_SIGN, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by fix_equal(), Init_Bignum(), and rb_integer_float_eq().
Definition at line 1737 of file bignum.c.
References BDIGIT, BDIGITS, MEMCMP, Qfalse, Qtrue, RB_TYPE_P, RBIGNUM_LEN, RBIGNUM_SIGN, and T_BIGNUM.
Referenced by Init_Bignum().
Definition at line 3123 of file bignum.c.
References big2dbl(), big_fdiv(), DBL2NUM, FIX2LONG, isinf(), isnan, rb_big2dbl(), rb_intern, rb_num_coerce_bin(), RFLOAT_VALUE, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by fix_fdiv(), and Init_Bignum().
Definition at line 2937 of file bignum.c.
References rb_big_divide(), and rb_intern.
Referenced by Init_Bignum().
Definition at line 3544 of file bignum.c.
References big2ulong(), big_lshift(), big_rshift(), bignorm(), check_shiftdown(), FIX2LONG, FIXNUM_P, NIL_P, rb_to_int(), RB_TYPE_P, RBIGNUM_SIGN, shift(), T_BIGNUM, and TRUE.
Referenced by fix_lshift(), Init_Bignum(), and rb_fix_lshift().
Definition at line 2068 of file bignum.c.
References bigadd(), bigadd_int(), bignorm(), bigsub_int(), DBL2NUM, FIX2LONG, rb_big2dbl(), rb_num_coerce_bin(), RBIGNUM_SIGN, RFLOAT_VALUE, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by fix_minus(), Init_Bignum(), rand_int(), rand_range(), sub(), and wsub().
Definition at line 2952 of file bignum.c.
References bigdivmod(), bignorm(), FIX2LONG, rb_int2big(), rb_num_coerce_bin(), T_BIGNUM, T_FIXNUM, and TYPE.
Referenced by fix_mod(), Init_Bignum(), and mod().
Definition at line 2660 of file bignum.c.
References bigmul0(), bignorm(), DBL2NUM, FIX2LONG, rb_big2dbl(), rb_int2big(), rb_num_coerce_bin(), RFLOAT_VALUE, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by f_imul(), fix_mul(), Init_Bignum(), int_pair_to_real_inclusive(), int_pow(), mul(), pack_unpack(), and wmul().
| VALUE rb_big_new | ( | long | , |
| int | |||
| ) |
Definition at line 186 of file bignum.c.
References bignew.
Referenced by int_pair_to_real_inclusive(), and mt_state().
Definition at line 282 of file bignum.c.
References bignorm().
Referenced by fix_aref(), limited_big_rand(), make_seed_value(), mt_state(), r_object0(), and rand_range().
Definition at line 3375 of file bignum.c.
References BDIGIT, BDIGITS, bignew, bignorm(), bigor_int(), BIGRAD, FIX2LONG, FIXNUM_P, get2comp(), i, rb_big_clone(), rb_num_coerce_bit(), RB_TYPE_P, RBIGNUM_LEN, RBIGNUM_SIGN, T_BIGNUM, and big_div_struct::zds.
Referenced by fix_or(), and Init_Bignum().
| void rb_big_pack | ( | VALUE | val, |
| unsigned long * | buf, | ||
| long | num_longs | ||
| ) |
Definition at line 369 of file bignum.c.
References BDIGIT, BDIGITS, BITSPERDIG, DIGSPERLONG, FIX2LONG, FIXNUM_P, i, rb_to_int(), RBIGNUM_LEN, and RBIGNUM_NEGATIVE_P.
Referenced by pack_pack().
Definition at line 2031 of file bignum.c.
References bigadd(), bigadd_int(), bignorm(), bigsub_int(), DBL2NUM, FIX2LONG, rb_big2dbl(), rb_num_coerce_bin(), RBIGNUM_SIGN, RFLOAT_VALUE, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by add(), fix_plus(), Init_Bignum(), pack_unpack(), rand_range(), rb_random_int32(), ulong_to_num_plus_1(), and wadd().
Definition at line 3175 of file bignum.c.
References bigmul0(), bignorm(), bigsqr(), bigtrunc(), BIGZEROP, BITSPERDIG, DBL2NUM, ffs(), FIX2LONG, FIXNUM_MAX, INT2FIX, rb_big2dbl(), rb_complex_raw1, rb_funcall(), rb_intern, rb_num_coerce_bin(), rb_rational_raw1, rb_warn(), RBIGNUM_DIGITS, RBIGNUM_LEN, RBIGNUM_SIGN, RFLOAT_VALUE, round(), SIGNED_VALUE, SIZEOF_BDIGITS, T_BIGNUM, T_FIXNUM, T_FLOAT, and TYPE.
Referenced by fix_pow(), Init_Bignum(), int_pow(), and power_cache_get_power0().
| void rb_big_resize | ( | VALUE | big, |
| long | len | ||
| ) |
Definition at line 160 of file bignum.c.
References rb_big_realloc(), and RBIGNUM_SET_LEN.
Referenced by big2str_karatsuba(), bigmul1_toom3(), bigtrunc(), get2comp(), make_seed_value(), r_object0(), and rb_big2str0().
Definition at line 3608 of file bignum.c.
References big2ulong(), big_lshift(), big_rshift(), bignorm(), check_shiftdown(), FIX2LONG, FIXNUM_P, NIL_P, rb_to_int(), RB_TYPE_P, RBIGNUM_SIGN, shift(), T_BIGNUM, and TRUE.
Referenced by Init_Bignum(), int_pair_to_real_inclusive(), and rb_fix_rshift().
Definition at line 1754 of file bignum.c.
References bignorm(), rb_big_clone(), RBIGNUM_SET_SIGN, and RBIGNUM_SIGN.
Referenced by Init_Bignum().
| VALUE rb_big_unpack | ( | unsigned long * | buf, |
| long | num_longs | ||
| ) |
Definition at line 411 of file bignum.c.
References BDIGIT, BDIGITS, BIGDN, BIGLO, bignew, bignorm(), DIGSPERLONG, get2comp(), i, INT2FIX, LONG2NUM, and RBIGNUM_SET_SIGN.
Referenced by pack_unpack().
Definition at line 3470 of file bignum.c.
References BDIGIT, BDIGITS, bignew, bignorm(), bigxor_int(), FIX2LONG, FIXNUM_P, get2comp(), i, rb_big_clone(), rb_num_coerce_bit(), RB_TYPE_P, RBIGNUM_LEN, RBIGNUM_SET_SIGN, RBIGNUM_SIGN, T_BIGNUM, and big_div_struct::zds.
Referenced by fix_xor(), and Init_Bignum().
| int rb_bigzero_p | ( | VALUE | x | ) |
Definition at line 91 of file bignum.c.
References BIGZEROP.
Referenced by rand_int(), and rand_range().
| VALUE rb_binding_new | ( | void | ) |
Definition at line 343 of file proc.c.
References rb_thread_struct::cfp, GET_THREAD(), and rb_binding_new_with_cfp().
Definition at line 1131 of file vm_eval.c.
References argc, iter_method_arg::argc, argv, iter_method_arg::argv, iterate_method(), iter_method_arg::mid, iter_method_arg::obj, and rb_iterate().
| int rb_block_given_p | ( | void | ) |
Definition at line 672 of file eval.c.
References rb_thread_struct::cfp, FALSE, GET_THREAD(), rb_vm_control_frame_block_ptr(), and TRUE.
Referenced by argf_bytes(), argf_chars(), argf_codepoints(), argf_lines(), dh_generate(), dir_s_chdir(), dir_s_glob(), dir_s_open(), dsa_generate(), enum_chunk(), enum_count(), enum_find_index(), enum_grep(), enum_inject(), enum_max(), enum_min(), enum_minmax(), enum_slice_before(), enum_zip(), enumerator_each(), enumerator_initialize(), env_delete_m(), env_fetch(), env_update_i(), etc_group(), etc_passwd(), fdbm_delete(), fdbm_fetch(), fdbm_fetch_m(), fdbm_s_open(), fgdbm_fetch(), fgdbm_fetch_m(), fgdbm_s_open(), fsdbm_delete(), fsdbm_fetch(), fsdbm_fetch_m(), fsdbm_s_open(), generator_initialize(), gzfile_wrap(), lazy_drop_while(), lazy_flat_map(), lazy_grep(), lazy_initialize(), lazy_map(), lazy_reject(), lazy_select(), lazy_take_while(), lazy_to_enum(), lazy_zip(), mSyslog_open(), obj_to_enum(), ossl_pem_passwd_cb(), ossl_x509store_verify(), p_gid_switch(), p_uid_switch(), pack_unpack(), path_each_line(), path_open(), path_s_glob(), path_sub(), proc_call(), pty_getpty(), pty_open(), range_max(), range_min(), rb_ary_count(), rb_ary_delete(), rb_ary_fetch(), rb_ary_fill(), rb_ary_index(), rb_ary_initialize(), rb_ary_product(), rb_ary_rindex(), rb_ary_sort_bang(), rb_ary_uniq(), rb_ary_uniq_bang(), rb_ary_zip(), rb_dlhandle_initialize(), rb_f_at_exit(), rb_f_open(), rb_fiddle_handle_initialize(), rb_gzreader_bytes(), rb_gzreader_lines(), rb_hash_delete(), rb_hash_fetch_m(), rb_hash_initialize(), rb_hash_update(), rb_io_bytes(), rb_io_chars(), rb_io_codepoints(), rb_io_lines(), rb_io_s_new(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_iterator_p(), rb_method_call(), rb_mod_initialize(), rb_mutex_synchronize_m(), rb_need_block(), rb_reg_match_m(), rb_scan_args(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_match_m(), rb_str_scan(), rb_str_sub_bang(), rb_struct_s_def(), rb_thread_s_handle_interrupt(), rsa_generate(), specific_eval(), strio_bytes(), strio_chars(), strio_codepoints(), strio_lines(), strio_s_open(), thread_initialize(), tk_s_new(), tracepoint_disable_m(), tracepoint_enable_m(), tracepoint_new_s(), window_attron(), zstream_detach_buffer(), zstream_expand_buffer(), and zstream_run().
| VALUE rb_block_lambda | ( | void | ) |
Definition at line 493 of file proc.c.
References proc_new(), rb_cProc, and TRUE.
| VALUE rb_block_proc | ( | void | ) |
Definition at line 479 of file proc.c.
References FALSE, proc_new(), and rb_cProc.
Definition at line 414 of file error.c.
References FIXNUM_P, NIL_P, rb_obj_classname(), RB_TYPE_P, SYMBOL_P, T_FALSE, and T_TRUE.
Referenced by rb_hash_s_create().
| const char* rb_builtin_type_name | ( | int | t | ) |
Definition at line 403 of file error.c.
References builtin_types, name, and numberof.
Referenced by rb_check_type().
| void rb_call_end_proc | ( | VALUE | data | ) |
Definition at line 11 of file eval_jump.c.
References rb_ary_new(), and rb_proc_call().
Referenced by m_core_set_postexe(), and rb_f_at_exit().
| void rb_call_inits | ( | void | ) |
Definition at line 273 of file vm_eval.c.
References GET_THREAD(), PASS_PASSED_BLOCK, and vm_call_super().
| int rb_char_to_option_kcode | ( | int | c, |
| int * | option, | ||
| int * | kcode | ||
| ) |
Definition at line 301 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, char_to_option(), rb_ascii8bit_encindex(), rb_enc_find_index(), and rb_utf8_encindex().
Definition at line 557 of file array.c.
References rb_check_convert_type(), and T_ARRAY.
Referenced by addrinfo_initialize(), dir_s_glob(), divmodv(), econv_init(), enum_zip(), flat_map_i(), flatten(), io_puts_ary(), lazy_flat_map_to_ary(), lazy_zip(), ossl_x509name_initialize(), path_split(), rb_Array(), rb_ary_assoc(), rb_ary_cmp(), rb_ary_initialize(), rb_ary_s_try_convert(), rb_ary_to_ary(), rb_check_argv(), rb_econv_init_by_convpath(), rb_execarg_addopt(), rb_hash_s_create(), rb_io_s_popen(), rb_reg_s_union_m(), rb_str_format_m(), rb_yield_splat(), sock_s_getnameinfo(), take_items(), time_timespec(), vm_yield_setup_block_args(), and wdivmod().
Definition at line 710 of file error.c.
References err, i, NIL_P, RARRAY_LEN, RARRAY_PTR, rb_ary_new3(), rb_backtrace_p(), rb_eTypeError, rb_raise(), RB_TYPE_P, T_ARRAY, and T_STRING.
Referenced by exc_set_backtrace(), and get_backtrace().
Definition at line 1153 of file vm_eval.c.
References argc, iter_method_arg::argc, argv, iter_method_arg::argv, iterate_check_method(), iter_method_arg::mid, iter_method_arg::obj, and rb_iterate().
Definition at line 2364 of file object.c.
References convert_type(), FALSE, NIL_P, Qnil, rb_eTypeError, rb_obj_classname(), rb_raise(), T_DATA, TYPE, and v.
Definition at line 2001 of file error.c.
References FL_ABLE, FL_TAINT, FL_UNTRUSTED, PRIsVALUE, rb_check_frozen_internal, rb_check_trusted_internal, rb_eSecurityError, rb_raise(), rb_safe_level, and RBASIC.
Referenced by random_init(), and random_load().
| void rb_check_frozen | ( | VALUE | ) |
Definition at line 1979 of file error.c.
References rb_check_frozen, and rb_check_frozen_internal.
|
inlinestatic |
Definition at line 254 of file intern.h.
References rb_check_frozen_internal.
Definition at line 408 of file vm_eval.c.
References check_funcall_callable(), check_funcall_missing(), check_funcall_respond_to(), CLASS_OF, GET_THREAD(), NOEX_OK, Qundef, rb_search_method_entry(), stack_check(), and vm_call0().
| VALUE rb_check_funcall_with_hook | ( | VALUE | recv, |
| ID | mid, | ||
| int | argc, | ||
| VALUE * | argv, | ||
| rb_check_funcall_hook * | hook, | ||
| VALUE | arg | ||
| ) |
Definition at line 427 of file vm_eval.c.
References arg, argc, argv, check_funcall_callable(), check_funcall_missing(), check_funcall_respond_to(), CLASS_OF, FALSE, GET_THREAD(), NOEX_OK, Qundef, rb_search_method_entry(), rescue_funcall_args::recv, stack_check(), TRUE, and vm_call0().
Definition at line 461 of file hash.c.
References rb_check_convert_type(), and T_HASH.
Returns ID for the given name if it is interned already, or 0.
| namep | the pointer to the name object |
namep must be a Symbol or a String, or possible to convert with to_str method. namep is a Symbol or a String if non-zero value is returned, or is a String if 0 is returned. Definition at line 16162 of file ripper.c.
References RString::as, RString::basic, RBasic::flags, global_symbols, RString::heap, id, RBasic::klass, name, NIL_P, OBJ_FREEZE, rb_check_string_type(), rb_cString, rb_enc_copy(), rb_eTypeError, RB_GC_GUARD, rb_id_attrset(), rb_inspect(), rb_is_attrset_name(), rb_raise(), RB_TYPE_P, RSTRING_LEN, RSTRING_NOEMBED, RSTRING_PTR, st_lookup(), SYM2ID, sym_check_asciionly(), symbols::sym_id, SYMBOL_P, and T_STRING.
Referenced by check_definition(), obj_respond_to(), rb_f_untrace_var(), rb_mod_alias_method(), rb_mod_autoload_p(), rb_mod_const_defined(), rb_mod_cvar_defined(), rb_mod_cvar_get(), rb_mod_instance_method(), rb_mod_method_defined(), rb_mod_public_instance_method(), rb_mod_remove_const(), rb_mod_remove_cvar(), rb_mod_remove_method(), rb_mod_undef_method(), rb_obj_ivar_defined(), rb_obj_ivar_get(), rb_obj_method(), rb_obj_public_method(), rb_obj_remove_instance_variable(), send_internal(), set_const_visibility(), set_method_visibility(), and vm_call_opt_send().
| ID rb_check_id_cstr | ( | const char * | ptr, |
| long | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 16209 of file ripper.c.
References RString::as, RString::basic, RBasic::flags, global_symbols, RString::heap, id, RBasic::klass, RString::len, rb_cString, rb_enc_associate(), rb_id_attrset(), rb_is_attrset_name(), RSTRING_NOEMBED, st_lookup(), sym_check_asciionly(), symbols::sym_id, and T_STRING.
Referenced by rb_mod_const_get(), rb_path_to_class(), and rb_str_format().
| void rb_check_safe_obj | ( | VALUE | ) |
Definition at line 113 of file safe.c.
References OBJ_TAINTED, rb_insecure_operation(), rb_safe_level, and rb_secure().
Definition at line 1508 of file string.c.
References rb_check_convert_type(), and T_STRING.
Definition at line 2687 of file object.c.
References Qnil, rb_check_convert_type(), rb_cNumeric, rb_obj_is_kind_of(), RB_TYPE_P, and T_FLOAT.
Definition at line 2418 of file object.c.
References rb_check_to_integer().
Definition at line 2398 of file object.c.
References convert_type(), FALSE, FIXNUM_P, Qnil, rb_cInteger, rb_obj_is_kind_of(), RB_TYPE_P, T_BIGNUM, and v.
| void rb_check_trusted | ( | VALUE | ) |
Definition at line 1995 of file error.c.
References rb_check_trusted, and rb_check_trusted_internal.
|
inlinestatic |
Definition at line 260 of file intern.h.
References rb_check_trusted_internal.
| void rb_check_type | ( | VALUE | , |
| int | |||
| ) |
Definition at line 440 of file error.c.
References builtin_class_name, Qundef, rb_bug(), rb_builtin_type_name(), rb_eTypeError, rb_fatal(), rb_raise(), RTYPEDDATA_P, T_DATA, T_MASK, and TYPE.
Referenced by tcl2rb_bool(), tcl2rb_num_or_nil(), tcl2rb_num_or_str(), tcl2rb_string(), and tkstr_to_number().
| void* rb_check_typeddata | ( | VALUE | , |
| const rb_data_type_t * | |||
| ) |
Definition at line 483 of file error.c.
References builtin_class_name, DATA_PTR, rb_eTypeError, rb_obj_classname(), rb_raise(), RB_TYPE_P, rb_typeddata_inherited_p(), RTYPEDDATA_P, RTYPEDDATA_TYPE, T_DATA, and rb_data_type_struct::wrap_struct_name.
Referenced by BigDecimal_initialize(), BigDecimal_initialize_copy(), check_addrinfo(), check_strscan(), dir_check(), dir_open_dir(), and econv_init().
Definition at line 384 of file variable.c.
References name, rb_class_name(), and RSTRING_PTR.
Definition at line 1804 of file object.c.
References RCLASS_SUPER.
Definition at line 1461 of file object.c.
References CLASS_OR_MODULE_P, mod, Qfalse, Qnil, Qtrue, rb_eTypeError, rb_raise(), RCLASS_M_TBL, RCLASS_ORIGIN, and RCLASS_SUPER.
Definition at line 378 of file variable.c.
References rb_class_path(), and rb_class_real().
Definition at line 1756 of file object.c.
References rb_obj_alloc(), and rb_obj_call_init().
Definition at line 1503 of file ruby.h.
References FIXNUM_P, FLONUM_P, IMMEDIATE_P, Qfalse, Qnil, Qtrue, rb_cFalseClass, rb_cFixnum, rb_cFloat, rb_cNilClass, rb_cSymbol, rb_cTrueClass, RBASIC, RTEST, and SYMBOL_P.
Definition at line 256 of file variable.c.
References NIL_P, fc_result::path, rb_ivar_set(), rb_str_dup(), and rb_tmp_class_path().
Definition at line 171 of file object.c.
References BUILTIN_TYPE, FL_SINGLETON, RBASIC, RCLASS_SUPER, and T_ICLASS.
Definition at line 1786 of file object.c.
References Qnil, rb_cBasicObject, rb_eTypeError, rb_raise(), RB_TYPE_P, RCLASS_SUPER, and T_ICLASS.
| void rb_clear_cache | ( | void | ) |
Definition at line 46 of file vm_method.c.
References rb_vm_change_state().
| void rb_clear_cache_by_class | ( | VALUE | ) |
Definition at line 64 of file vm_method.c.
References rb_vm_change_state().
| void rb_clear_trace_func | ( | void | ) |
Definition at line 215 of file vm_trace.c.
References clear_trace_func_i(), GET_VM, rb_remove_event_hook(), and st_foreach().
| int rb_cloexec_dup | ( | int | oldfd | ) |
Definition at line 225 of file io.c.
References rb_cloexec_fcntl_dupfd().
| int rb_cloexec_dup2 | ( | int | oldfd, |
| int | newfd | ||
| ) |
Definition at line 232 of file io.c.
References dup2(), errno, O_CLOEXEC, rb_maygvl_fd_fix_cloexec(), and rb_w32_get_osfhandle().
| int rb_cloexec_fcntl_dupfd | ( | int | fd, |
| int | minfd | ||
| ) |
Definition at line 308 of file io.c.
References errno, F_DUPFD, fcntl(), rb_cloexec_fcntl_dupfd(), and rb_maygvl_fd_fix_cloexec().
Definition at line 209 of file io.c.
References O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
| int rb_cloexec_pipe | ( | int | fildes[2] | ) |
Definition at line 271 of file io.c.
References errno, O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
| void rb_close_before_exec | ( | int | lowfd, |
| int | maxhint, | ||
| VALUE | noclose_fds | ||
| ) |
Definition at line 97 of file bignum.c.
References BIGZEROP, FIX2LONG, FIXNUM_P, INT2FIX, NIL_P, rb_cmperr(), rb_funcall(), RB_TYPE_P, RBIGNUM_SIGN, RTEST, and T_BIGNUM.
Referenced by cmp(), cmp_eq(), cmp_ge(), cmp_gt(), cmp_le(), cmp_lt(), enum_each_cons_size(), flo_cmp(), max_by_i(), max_i(), max_ii(), min_by_i(), min_i(), min_ii(), minmax_by_i(), minmax_by_i_update(), minmax_i(), minmax_i_update(), minmax_ii(), minmax_ii_update(), r_le(), r_lt(), range_bsearch(), range_max(), range_min(), rb_ary_bsearch(), rb_invcmp(), sort_1(), sort_2(), sort_by_cmp(), and wcmp().
Definition at line 11104 of file ripper.c.
References parser_compile_string(), rb_parser_new(), and rb_str_new().
Referenced by rb_load_file().
Definition at line 11124 of file ripper.c.
References rb_parser_compile_file(), and rb_parser_new().
Referenced by rb_iseq_compile_with_option().
Definition at line 11090 of file ripper.c.
References must_be_ascii_compatible(), parser_compile_string(), and rb_parser_new().
Definition at line 1388 of file complex.c.
References nucomp_s_convert(), and rb_cComplex.
Referenced by nurat_coerce().
Definition at line 1374 of file complex.c.
References nucomp_s_canonicalize_internal(), and rb_cComplex.
Referenced by num_imaginary().
Definition at line 1380 of file complex.c.
References f_complex_polar(), and rb_cComplex.
Referenced by read_comp().
Definition at line 1368 of file complex.c.
References nucomp_s_new_internal(), and rb_cComplex.
Definition at line 2098 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 2104 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 2092 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 1871 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1877 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1865 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
| VALUE rb_const_list | ( | void * | ) |
Definition at line 2012 of file variable.c.
References list_i(), st_table::num_entries, rb_ary_new2(), st_foreach_safe(), and st_free_table().
Definition at line 1933 of file variable.c.
References autoload_delete(), id, OBJ_UNTRUSTED, PRIsVALUE, Qnil, Qundef, QUOTE_ID, rb_check_frozen, rb_class_name(), rb_const_defined_at(), rb_eSecurityError, rb_name_error(), rb_raise(), rb_safe_level, rb_vm_change_state(), RCLASS_CONST_TBL, st_delete(), v, val, and xfree.
Definition at line 2136 of file variable.c.
References ALLOC, autoload_data(), autoload_delete(), check_autoload_data, check_before_mod_set(), CONST_PUBLIC, rb_const_entry_struct::file, rb_const_entry_struct::flag, rb_const_entry_struct::line, NIL_P, PRIsVALUE, Qundef, QUOTE_ID, rb_class_name(), rb_cObject, rb_compile_warn(), rb_eTypeError, rb_raise(), rb_sourcefilename(), rb_sourceline(), rb_thread_current(), rb_vm_change_state(), rb_warn(), RCLASS_CONST_TBL, RSTRING_PTR, st_init_numtable(), st_insert(), st_lookup(), autoload_data_i::thread, rb_const_entry_struct::value, and autoload_data_i::value.
Definition at line 2349 of file object.c.
References convert_type(), rb_eTypeError, rb_obj_classname(), rb_raise(), TRUE, TYPE, and v.
Definition at line 1042 of file variable.c.
References trace_var::data, FL_EXIVAR, FL_SET, FL_TEST, FL_UNSET, st_table::num_entries, rb_free_generic_ivar(), st_add_direct(), st_copy(), st_free_table(), st_insert(), and st_lookup().
Definition at line 865 of file bignum.c.
References rb_cstr_to_inum().
Referenced by JSON_parse_integer().
| double rb_cstr_to_dbl | ( | const char * | , |
| int | |||
| ) |
Definition at line 2516 of file object.c.
References bad, buf, DBL_DIG, errno, ISDIGIT, ISSPACE, OutOfRange, p, rb_eArgError, rb_invalid_str(), rb_raise(), rb_warning(), and strtod.
Definition at line 579 of file bignum.c.
References bad, BDIGIT, BDIGIT_DBL, BDIGITS, BIGDN, BIGLO, bignew, bignorm(), BITSPERDIG, c, CHAR_BIT, conv_digit, i, INT2FIX, ISSPACE, LONG2FIX, POSFIXABLE, rb_eArgError, rb_invalid_str(), rb_raise(), rb_uint2big(), RBIGNUM_SET_SIGN, result, strlen(), STRTOUL, and val.
Referenced by asn1integer_to_num(), ossl_bn_to_i(), parser_yylex(), rb_cstr2inum(), rb_str_to_inum(), read_digits(), str2num(), and tkstr_to_int().
| VALUE rb_current_realfilepath | ( | void | ) |
Definition at line 1934 of file vm_eval.c.
References rb_iseq_location_struct::absolute_path, rb_thread_struct::cfp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::location, Qnil, RUBY_VM_PREVIOUS_CONTROL_FRAME, and vm_get_ruby_level_caller_cfp().
Definition at line 2402 of file variable.c.
References rb_cvar_get(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2392 of file variable.c.
References rb_cvar_set(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2384 of file variable.c.
References CVAR_LOOKUP, Qfalse, and Qtrue.
Definition at line 2357 of file variable.c.
References BUILTIN_TYPE, CVAR_LOOKUP, id, original_module(), PRIsVALUE, QUOTE_ID, rb_class_name(), rb_name_error(), rb_warning(), RCLASS_IV_TBL, RTEST, ruby_verbose, st_delete(), and T_CLASS.
Definition at line 2324 of file variable.c.
References BUILTIN_TYPE, check_before_mod_set(), CVAR_LOOKUP, id, original_module(), PRIsVALUE, QUOTE_ID, rb_class_name(), rb_warning(), RCLASS_IV_TBL, RTEST, ruby_verbose, st_delete(), st_init_numtable(), st_insert(), and T_CLASS.
| VALUE rb_data_object_alloc | ( | VALUE | , |
| void * | , | ||
| RUBY_DATA_FUNC | , | ||
| RUBY_DATA_FUNC | |||
| ) |
| VALUE rb_data_typed_object_alloc | ( | VALUE | klass, |
| void * | datap, | ||
| const rb_data_type_t * | |||
| ) |
| VALUE rb_dbl2big | ( | double | ) |
Definition at line 1353 of file bignum.c.
References bignorm(), and dbl2big().
Referenced by case_when_optimizable_literal(), dbl2ival(), fix_divide(), flo_ceil(), flo_floor(), flo_truncate(), float_decode_internal(), nurat_div(), rb_big_divide(), rb_convert_to_integer(), rb_integer_float_cmp(), rb_integer_float_eq(), and rb_str_format().
| VALUE rb_dbl_cmp | ( | double | , |
| double | |||
| ) |
| rb_encoding* rb_default_external_encoding | ( | void | ) |
Definition at line 1286 of file encoding.c.
References default_encoding::enc, default_encoding::index, rb_enc_from_index(), and rb_locale_encoding().
Referenced by argf_external_encoding(), argf_internal_encoding(), enc_set_filesystem_encoding(), gzfile_new(), io_read_encoding(), ole_init_cp(), rb_enc_default_external(), rb_enc_reg_error_desc(), rb_external_str_new(), rb_external_str_new_cstr(), rb_inspect(), rb_io_ext_int_to_encs(), rb_reg_desc(), rb_str_export(), rb_str_inspect(), rb_str_quote_unprintable(), rb_str_symname_p(), require_libraries(), strio_init(), strio_set_encoding(), and validate_enc_binmode().
| rb_encoding* rb_default_internal_encoding | ( | void | ) |
Definition at line 1371 of file encoding.c.
References default_encoding::enc, default_encoding::index, and rb_enc_from_index().
Referenced by file_path_convert(), int_chr(), ole_init_cp(), parse(), process_options(), rb_enc_default_internal(), rb_enc_reg_error_desc(), rb_external_str_new_with_enc(), rb_io_ext_int_to_encs(), rb_reg_desc(), rb_str_inspect(), rb_str_quote_unprintable(), and rb_str_symname_p().
| void rb_define_alloc_func | ( | VALUE | , |
| rb_alloc_func_t | |||
| ) |
Definition at line 2412 of file variable.c.
References rb_cvar_set(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2197 of file variable.c.
References rb_cObject, rb_const_set(), rb_intern, rb_is_const_id(), rb_secure(), and rb_warn().
| int rb_define_dummy_encoding | ( | const char * | ) |
Definition at line 400 of file encoding.c.
References rb_encoding_entry::enc, ENC_SET_DUMMY, enc_table, rb_ascii8bit_encoding(), and rb_enc_replicate().
Referenced by create_dummy_encoding_for_tk_core(), make_dummy_encoding(), ole_cp2encoding(), rb_nkf_enc_get(), and str_transcode0().
Definition at line 2211 of file variable.c.
References rb_cObject, and rb_define_const().
Definition at line 570 of file variable.c.
References global_variable::data, global_variable::getter, global_id(), gvar_getter_t, gvar_setter_t, global_variable::marker, Qnil, RB_GC_GUARD, rb_global_entry(), global_variable::setter, rb_global_entry::var, var_getter, var_marker, and var_setter.
Definition at line 595 of file variable.c.
References rb_define_hooked_variable(), and readonly_setter.
Definition at line 589 of file variable.c.
References rb_define_hooked_variable().
Definition at line 601 of file variable.c.
References global_variable::getter, rb_define_hooked_variable(), readonly_setter, global_variable::setter, and val_getter.
| VALUE rb_detach_process | ( | rb_pid_t | pid | ) |
Definition at line 976 of file process.c.
References detach_process_pid(), detach_process_watcher(), id_pid(), PIDT2NUM, rb_define_singleton_method(), rb_thread_create(), and rb_thread_local_aset().
| VALUE rb_dir_getwd | ( | void | ) |
Definition at line 878 of file dir.c.
References my_getcwd, rb_enc_associate(), rb_filesystem_encoding(), rb_secure(), rb_tainted_str_new2, and xfree.
Referenced by dir_s_chdir(), dir_s_getwd(), and rb_realpath_internal().
| int rb_during_gc | ( | void | ) |
Definition at line 3117 of file gc.c.
References during_gc, and rb_objspace.
| int rb_dvar_defined | ( | ID | ) |
Definition at line 5832 of file compile.c.
References rb_thread_struct::base_block, GET_THREAD(), i, rb_block_struct::iseq, rb_iseq_struct::local_table, rb_iseq_struct::local_table_size, rb_iseq_struct::parent_iseq, and rb_iseq_struct::type.
Referenced by dvar_defined_gen().
Definition at line 1166 of file vm_eval.c.
References CALL_FCALL, and rb_call().
Definition at line 1786 of file transcode.c.
References asciicompat_encoding_t::ascii_compat_name, asciicompat_encoding_t::ascii_incompat_name, asciicompat_encoding_i(), NULL, st_table::num_entries, st_foreach(), st_lookup(), and v.
| void rb_econv_binmode | ( | rb_econv_t * | ec | ) |
Definition at line 1934 of file transcode.c.
References ECONV_CR_NEWLINE_DECORATOR, ECONV_CRLF_NEWLINE_DECORATOR, ECONV_NEWLINE_DECORATOR_MASK, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_econv_t::elems, rb_econv_t::flags, get_transcoder_entry(), i, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_transcoding_close(), rb_econv_elem_t::tc, rb_transcoding::transcoder, transcoder_entry_t::transcoder, and xfree.
| void rb_econv_check_error | ( | rb_econv_t * | ec | ) |
Definition at line 4194 of file transcode.c.
References make_econv_exception(), NIL_P, and rb_exc_raise().
| void rb_econv_close | ( | rb_econv_t * | ec | ) |
Definition at line 1702 of file transcode.c.
References rb_econv_t::elems, i, rb_econv_t::in_buf_start, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_transcoding_close(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_str, rb_econv_elem_t::tc, and xfree.
| rb_econv_result_t rb_econv_convert | ( | rb_econv_t * | ec, |
| const unsigned char ** | source_buffer_ptr, | ||
| const unsigned char * | source_buffer_end, | ||
| unsigned char ** | destination_buffer_ptr, | ||
| unsigned char * | destination_buffer_end, | ||
| int | flags | ||
| ) |
Definition at line 1446 of file transcode.c.
References econv_incomplete_input, econv_invalid_byte_sequence, ECONV_INVALID_MASK, ECONV_INVALID_REPLACE, ECONV_UNDEF_HEX_CHARREF, ECONV_UNDEF_MASK, ECONV_UNDEF_REPLACE, econv_undefined_conversion, rb_econv_t::flags, output_hex_charref(), output_replacement_character(), rb_econv_convert0(), and rb_econv_t::started.
| int rb_econv_decorate_at_first | ( | rb_econv_t * | ec, |
| const char * | decorator_name | ||
| ) |
Definition at line 1900 of file transcode.c.
References asciicompat_decoder, rb_transcoder::asciicompat_type, DECORATOR_P, rb_transcoder::dst_encoding, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_decorate_at(), rb_transcoder::src_encoding, rb_econv_elem_t::tc, and rb_transcoding::transcoder.
| int rb_econv_decorate_at_last | ( | rb_econv_t * | ec, |
| const char * | decorator_name | ||
| ) |
Definition at line 1917 of file transcode.c.
References asciicompat_encoder, rb_transcoder::asciicompat_type, DECORATOR_P, rb_transcoder::dst_encoding, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_decorate_at(), rb_transcoder::src_encoding, rb_econv_elem_t::tc, and rb_transcoding::transcoder.
| const char* rb_econv_encoding_to_insert_output | ( | rb_econv_t * | ec | ) |
Definition at line 1503 of file transcode.c.
References asciicompat_encoder, rb_transcoder::asciicompat_type, rb_transcoder::dst_encoding, rb_econv_t::last_tc, NULL, rb_transcoder::src_encoding, and rb_transcoding::transcoder.
Definition at line 3150 of file transcode.c.
References Qnil, RTEST, search_convpath_i(), and transcode_search_path().
| int rb_econv_insert_output | ( | rb_econv_t * | ec, |
| const unsigned char * | str, | ||
| size_t | len, | ||
| const char * | str_encoding | ||
| ) |
Definition at line 1587 of file transcode.c.
References allocate_converted_string(), asciicompat_encoder, rb_transcoder::asciicompat_type, buf, rb_econv_t::elems, encoding_equal, fail, rb_econv_t::in_buf_end, rb_econv_t::in_buf_start, rb_econv_t::in_data_end, rb_econv_t::in_data_start, MEMMOVE, NULL, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_end, rb_econv_elem_t::out_buf_start, rb_econv_elem_t::out_data_end, rb_econv_elem_t::out_data_start, rb_econv_encoding_to_insert_output(), rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_t::started, rb_econv_elem_t::tc, rb_transcoding::transcoder, TRANSCODING_READBUF, xfree, xmalloc, and xrealloc.
| VALUE rb_econv_make_exception | ( | rb_econv_t * | ec | ) |
Definition at line 4188 of file transcode.c.
References make_econv_exception().
| rb_econv_t* rb_econv_open | ( | const char * | source_encoding, |
| const char * | destination_encoding, | ||
| int | ecflags | ||
| ) |
Definition at line 1067 of file transcode.c.
References decorator_names(), ECONV_ERROR_HANDLER_MASK, rb_econv_t::flags, i, MAX_ECFLAGS_DECORATORS, NULL, rb_econv_close(), rb_econv_decorate_at_last(), and rb_econv_open0().
Definition at line 2028 of file transcode.c.
References econv_description(), rb_eConverterNotFoundError, rb_exc_new3(), rb_str_cat2(), and rb_str_new_cstr().
| rb_econv_t* rb_econv_open_opts | ( | const char * | source_encoding, |
| const char * | destination_encoding, | ||
| int | ecflags, | ||
| VALUE | ecopts | ||
| ) |
Definition at line 2570 of file transcode.c.
References NIL_P, NULL, OBJ_FROZEN, Qnil, rb_bug(), rb_econv_close(), rb_econv_open(), rb_econv_set_replacement(), rb_enc_get(), rb_enc_name, rb_hash_aref(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, sym_replace, and T_HASH.
Definition at line 2519 of file transcode.c.
References econv_opts(), ENC_CODERANGE_BROKEN, NIL_P, Qnil, rb_check_hash_type(), rb_eArgError, rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), rb_hash_aref(), rb_hash_aset(), rb_hash_freeze(), rb_hash_new(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_respond_to(), rb_str_dump(), rb_str_new_frozen(), StringValue, StringValueCStr, sym_aref, sym_fallback, sym_replace, and v.
Definition at line 2564 of file transcode.c.
References rb_econv_prepare_options().
| void rb_econv_putback | ( | rb_econv_t * | ec, |
| unsigned char * | p, | ||
| int | n | ||
| ) |
Definition at line 1753 of file transcode.c.
References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_elem_t::tc, and TRANSCODING_READBUF.
| int rb_econv_putbackable | ( | rb_econv_t * | ec | ) |
Definition at line 1742 of file transcode.c.
References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, and rb_econv_elem_t::tc.
| int rb_econv_set_replacement | ( | rb_econv_t * | ec, |
| const unsigned char * | str, | ||
| size_t | len, | ||
| const char * | encname | ||
| ) |
Definition at line 2190 of file transcode.c.
References allocate_converted_string(), encoding_equal, MEMCPY, NULL, rb_econv_encoding_to_insert_output(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_enc, rb_econv_t::replacement_len, rb_econv_t::replacement_str, xfree, and xmalloc.
| VALUE rb_econv_str_append | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| VALUE | dst, | ||
| int | flags | ||
| ) |
Definition at line 1857 of file transcode.c.
References rb_econv_substr_append(), and RSTRING_LEN.
| VALUE rb_econv_str_convert | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| int | flags | ||
| ) |
Definition at line 1869 of file transcode.c.
References Qnil, rb_econv_substr_append(), and RSTRING_LEN.
| VALUE rb_econv_substr_append | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| long | byteoff, | ||
| long | bytesize, | ||
| VALUE | dst, | ||
| int | flags | ||
| ) |
Definition at line 1813 of file transcode.c.
References rb_econv_t::destination_encoding, dp, econv_destination_buffer_full, rb_econv_t::last_tc, LONG_MAX, rb_transcoder::max_output, NIL_P, rb_eArgError, rb_econv_check_error(), rb_econv_convert(), rb_enc_associate(), rb_raise(), rb_str_buf_new(), rb_str_capacity(), rb_str_resize(), rb_str_set_len(), RSTRING_LEN, RSTRING_PTR, and rb_transcoding::transcoder.
| VALUE rb_econv_substr_convert | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| long | byteoff, | ||
| long | bytesize, | ||
| int | flags | ||
| ) |
Definition at line 1863 of file transcode.c.
References Qnil, and rb_econv_substr_append().
| int rb_enc_ascget | ( | const char * | p, |
| const char * | e, | ||
| int * | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 908 of file encoding.c.
References c, ISASCII, MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_isascii, rb_enc_mbc_to_codepoint, and rb_enc_precise_mbclen().
Referenced by check_pipe_command(), chopped_length(), rb_reg_expr_str(), rb_reg_quote(), rb_str_casecmp(), rb_str_chomp_bang(), rb_str_split_m(), rmext(), str_end_with_asciichar(), swallow(), tr_setup_table(), tr_trans(), and trnext().
| VALUE rb_enc_associate | ( | VALUE | , |
| rb_encoding * | |||
| ) |
Definition at line 764 of file encoding.c.
References rb_enc_associate_index(), and rb_enc_to_index.
Referenced by append_fspath(), econv_primitive_convert(), econv_putback(), gzfile_getc(), gzfile_newstr(), intern_str(), io_enc_str(), io_shift_cbuf(), lex_getline(), load_file_internal(), locale_path(), parser_nextc(), parser_str_new(), process_options(), rb_ary_join(), rb_check_id_cstr(), rb_dir_getwd(), rb_econv_substr_append(), rb_enc_reg_error_desc(), rb_enc_str_new(), rb_enc_vsprintf(), rb_external_str_new_with_enc(), rb_file_expand_path_internal(), rb_file_join(), rb_home_dir(), rb_intern3(), rb_nkf_convert(), rb_reg_desc(), rb_reg_initialize(), rb_reg_preprocess(), rb_reg_preprocess_dregexp(), rb_reg_quote(), rb_reg_s_union(), rb_str_append(), rb_str_concat(), rb_str_dump(), rb_str_ellipsize(), rb_str_encode_ospath(), rb_str_force_encoding(), rb_str_format(), rb_str_inspect(), rb_str_justify(), rb_str_shared_replace(), rb_str_splice(), rb_str_sub_bang(), rb_str_subpat_set(), reg_fragment_setenc_gen(), require_libraries(), ruby__sfvextra(), RUBY_ALIAS_FUNCTION(), str_gsub(), strio_read(), strio_set_encoding(), syserr_initialize(), and tr_trans().
Definition at line 746 of file encoding.c.
References ENC_CODERANGE_ASCIIONLY, ENC_CODERANGE_CLEAR, enc_set_index(), rb_check_frozen, rb_eArgError, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_raise(), and SPECIAL_CONST_P.
Referenced by encoded_dup(), lib_fromUTF8_core(), lib_split_tklist_core(), lib_toUTF8_core(), lib_UTF_backslash_core(), make_econv_exception(), parser_set_encode(), r_ivar(), r_symreal(), rb_enc_associate(), rb_enc_copy(), rb_find_file_ext_safe(), rb_find_file_safe(), str_encode_associate(), and str_encode_bang().
| int rb_enc_casefold | ( | char * | to, |
| const char * | p, | ||
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
| rb_encoding* rb_enc_check | ( | VALUE | , |
| VALUE | |||
| ) |
Definition at line 776 of file encoding.c.
References rb_encoding_entry::enc, rb_eEncCompatError, rb_enc_compatible(), rb_enc_get(), rb_enc_name, and rb_raise().
Referenced by append_fspath(), rb_file_expand_path_internal(), rb_file_join(), rb_str_append(), rb_str_chomp_bang(), rb_str_count(), rb_str_delete_bang(), rb_str_end_with(), rb_str_enumerate_lines(), rb_str_format(), rb_str_index(), rb_str_index_m(), rb_str_justify(), rb_str_plus(), rb_str_rindex(), rb_str_splice(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_start_with(), rb_str_subpat_set(), rb_str_upto(), readline_attempted_completion_function(), realpath_rec(), and tr_trans().
| int rb_enc_codelen | ( | int | code, |
| rb_encoding * | enc | ||
| ) |
Definition at line 952 of file encoding.c.
References ONIGENC_CODE_TO_MBCLEN, rb_eArgError, rb_enc_name, and rb_raise().
Referenced by parser_tokaddmbc(), rb_enc_uint_chr(), rb_str_buf_cat_ascii(), rb_str_concat(), rb_str_format(), strio_ungetc(), and tr_trans().
| unsigned int rb_enc_codepoint | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 946 of file encoding.c.
References rb_enc_codepoint, and rb_enc_codepoint_len().
| unsigned int rb_enc_codepoint_len | ( | const char * | p, |
| const char * | e, | ||
| int * | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 931 of file encoding.c.
References MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_eArgError, rb_enc_mbc_to_codepoint, rb_enc_name, rb_enc_precise_mbclen(), and rb_raise().
Referenced by rb_enc_codepoint(), rb_str_capitalize_bang(), rb_str_count(), rb_str_delete_bang(), rb_str_downcase_bang(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_format(), rb_str_lstrip_bang(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), readline_attempted_completion_function(), rmext(), strio_each_codepoint(), sym_printable(), tr_trans(), and trnext().
| rb_encoding* rb_enc_compatible | ( | VALUE | , |
| VALUE | |||
| ) |
Definition at line 787 of file encoding.c.
References ENC_CODERANGE_7BIT, ENCINDEX_US_ASCII, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_enc_str_asciionly_p(), rb_enc_str_coderange(), RB_TYPE_P, RSTRING_LEN, and T_STRING.
Referenced by enc_compatible_p(), file_s_fnmatch(), literal_concat0(), location_format(), rb_enc_check(), rb_file_s_basename(), rb_str_casecmp(), rb_str_sub_bang(), and ruby__sfvextra().
Definition at line 854 of file encoding.c.
References rb_enc_associate_index(), and rb_enc_get_index().
Referenced by ary_join_0(), ary_join_1(), date_s__parse_internal(), date_s__strptime_internal(), date_strftime_internal(), inspect_ary(), inspect_i(), rb_attr(), rb_check_id(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_file_s_basename(), rb_reg_desc(), rb_reg_quote(), rb_reg_s_union(), rb_reg_to_s(), rb_str_format(), RUBY_ALIAS_FUNCTION(), str_new(), and strio_read().
| VALUE rb_enc_default_external | ( | void | ) |
Definition at line 1300 of file encoding.c.
References rb_default_external_encoding(), and rb_enc_from_encoding().
Referenced by encoding_table_get_name_core(), and get_default_external().
| VALUE rb_enc_default_internal | ( | void | ) |
Definition at line 1380 of file encoding.c.
References rb_default_internal_encoding(), and rb_enc_from_encoding().
Referenced by encoding_table_get_name_core(), get_default_internal(), and str_transcode0().
|
inlinestatic |
Definition at line 235 of file encoding.h.
References ENC_DUMMY_P.
| int rb_enc_fast_mbclen | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 878 of file encoding.c.
References ONIGENC_MBC_ENC_LEN, and UChar.
Referenced by enc_strlen(), rb_str_enumerate_chars(), rb_str_reverse(), rb_str_split_m(), scan_once(), and str_gsub().
| rb_encoding* rb_enc_find | ( | const char * | name | ) |
Definition at line 657 of file encoding.c.
References rb_enc_find_index(), and rb_enc_from_index().
Referenced by econv_get_replacement(), econv_insert_output(), make_encoding(), make_replacement(), rb_str_inspect(), rb_w32_conv_from_wchar(), rb_w32_write_console(), and transcode_loop().
| int rb_enc_find_index | ( | const char * | name | ) |
Definition at line 633 of file encoding.c.
References rb_encoding_entry::enc, enc_autoload(), enc_autoload_p, i, load_encoding(), rb_eArgError, rb_enc_from_index(), rb_enc_registered(), rb_raise(), rb_warn(), and UNSPECIFIED_ENCODING.
Referenced by create_dummy_encoding_for_tk_core(), create_encoding_table_core(), enc_set_filesystem_encoding(), encoding_table_get_name_core(), id2encidx(), Init_tcltklib(), io_strip_bom(), lib_fromUTF8_core(), make_econv_exception(), ole_cp2encoding(), opt_enc_index(), parse_mode_enc(), parser_set_encode(), process_options(), rb_char_to_option_kcode(), rb_econv_open0(), rb_enc_alias(), rb_enc_find(), rb_locale_encindex(), rb_nkf_enc_get(), rb_to_encoding_index(), str_find_encindex(), transcode_io(), transcode_string(), and update_encoding_table().
| VALUE rb_enc_from_encoding | ( | rb_encoding * | enc | ) |
Definition at line 103 of file encoding.c.
References ENC_TO_ENCINDEX, Qnil, and rb_enc_from_encoding_index().
Referenced by argf_external_encoding(), argf_internal_encoding(), code_page(), create_dummy_encoding_for_tk_core(), create_encoding_table_core(), do_writeconv(), econv_destination_encoding(), econv_insert_output(), econv_s_asciicompat_encoding(), econv_source_encoding(), enc_compatible_p(), encoding_table_get_name_core(), fix_string_encoding(), get_user_from_path(), gettable_gen(), Init_nkf(), io_set_encoding_by_bom(), load_file_internal(), make_econv_exception(), make_encobj(), process_options(), rb_enc_default_external(), rb_enc_default_internal(), rb_file_expand_path_internal(), rb_io_external_encoding(), rb_io_getline_1(), rb_io_internal_encoding(), rb_nkf_guess(), rb_parser_encoding(), rb_str_ellipsize(), rb_str_encode_ospath(), rb_w32_conv_from_wchar(), rb_w32_write_console(), readline_attempted_completion_function(), set_encoding_const(), strio_external_encoding(), and update_encoding_table().
| rb_encoding* rb_enc_from_index | ( | int | idx | ) |
Definition at line 548 of file encoding.c.
References enc_table, and rb_enc_init().
Referenced by check_encoding(), create_dummy_encoding_for_tk_core(), create_encoding_table_core(), econv_args(), enc_alias(), enc_arg(), enc_replicate_with_index(), encoding_table_get_name_core(), file_path_convert(), io_set_encoding_by_bom(), load_file_internal(), make_dummy_encoding(), make_econv_exception(), ole_cp2encoding(), opt_enc_index(), parse_mode_enc(), parser_set_encode(), process_options(), rb_default_external_encoding(), rb_default_internal_encoding(), rb_econv_open0(), rb_enc_aliases_enc_i(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_cr_str_buf_cat(), rb_enc_find(), rb_enc_find_index(), rb_enc_get(), rb_enc_register(), rb_enc_replicate(), rb_enc_set_base(), rb_encdb_declare(), rb_encdb_replicate(), rb_encdb_set_unicode(), rb_filesystem_encoding(), rb_find_encoding(), rb_io_extract_encoding_option(), rb_locale_encoding(), rb_nkf_enc_get(), rb_str_buf_cat_ascii(), rb_str_comparable(), str_encode_associate(), str_end_with_asciichar(), str_to_encoding(), str_transcode_enc_args(), update_encoding_table(), and w_encoding().
| rb_encoding* rb_enc_get | ( | VALUE | ) |
Definition at line 770 of file encoding.c.
References rb_enc_from_index(), and rb_enc_get_index().
Referenced by check_dirname(), check_path_encoding(), check_pipe_command(), do_writeconv(), econv_set_replacement(), file_s_fnmatch(), fnmatch_brace(), intern_str(), io_encoding_set(), literal_concat0(), must_be_ascii_compatible(), must_not_be_anonymous(), ole_vstr2wc(), parser_prepare(), parser_yyerror(), path_check_0(), path_sub_ext(), prepare_getline_args(), push_glob(), rb_econv_open_opts(), rb_econv_prepare_options(), rb_enc_check(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_file_s_basename(), rb_file_s_extname(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_inspect(), rb_mod_const_get(), rb_must_asciicompat(), rb_path_to_class(), rb_push_glob(), rb_realpath_internal(), rb_reg_check_preprocess(), rb_reg_desc(), rb_reg_error_desc(), rb_reg_init_copy(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_quote(), rb_reg_regsub(), rb_reg_s_union(), rb_reg_source(), rb_reg_to_s(), rb_str_chomp_bang(), rb_str_dump(), rb_str_each_char_size(), rb_str_ellipsize(), rb_str_encode_ospath(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_format(), rb_str_symname_type(), rb_to_encoding_index(), rb_w32_write_console(), realpath_rec(), reg_enc_error(), reg_fragment_setenc_gen(), reg_named_capture_assign_gen(), ruby__sfvextra(), RUBY_ALIAS_FUNCTION(), str_find_encindex(), strio_each_codepoint(), strio_external_encoding(), strio_getc(), strio_getline(), strio_substr(), strio_ungetc(), strio_write(), strscan_getch(), sym_check_asciionly(), syserr_initialize(), time_strftime(), transcode_loop(), and update_char_offset().
| int rb_enc_get_index | ( | VALUE | obj | ) |
Definition at line 688 of file encoding.c.
References BUILTIN_TYPE, enc_check_encoding(), ENCODING_GET_INLINED, ENCODING_INLINE_MAX, i, is_data_encoding, NIL_P, NUM2INT, rb_funcall(), rb_id2str(), rb_id_encoding(), rb_intern, rb_ivar_get(), SPECIAL_CONST_P, SYM2ID, SYMBOL_P, T_DATA, T_FILE, T_REGEXP, and T_STRING.
Referenced by lib_fromUTF8_core(), lib_split_tklist_core(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_copy(), rb_enc_get(), rb_obj_encoding(), str_transcode_enc_args(), transcode_string(), w_encoding(), and w_symbol().
| int rb_enc_mbclen | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 884 of file encoding.c.
References MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, ONIGENC_PRECISE_MBC_ENC_LEN, rb_enc_mbminlen, and UChar.
Referenced by bracket(), enc_strlen(), gzfile_getc(), intern_str(), io_getc(), is_special_global_name(), rb_enc_symname_type(), rb_str_casecmp(), rb_str_each_char_size(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_format(), rb_str_reverse(), str_nth_len(), strio_getc(), strio_ungetc(), and strscan_getch().
| char* rb_enc_nth | ( | const char * | , |
| const char * | , | ||
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 1582 of file string.c.
References str_nth_len().
| char* rb_enc_path_end | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
Definition at line 2840 of file file.c.
References chompdirsep(), and isdirsep.
| char* rb_enc_path_last_separator | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
| char* rb_enc_path_next | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
| char* rb_enc_path_skip_prefix | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
Definition at line 2772 of file file.c.
References isdirsep, and rb_enc_path_next().
| int rb_enc_precise_mbclen | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 896 of file encoding.c.
References ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE, ONIGENC_PRECISE_MBC_ENC_LEN, and UChar.
Referenced by coderange_scan(), enc_pred_char(), enc_succ_char(), fnmatch_helper(), gzreader_charboundary(), io_getc(), make_econv_exception(), rb_enc_ascget(), rb_enc_codepoint_len(), rb_enc_strlen_cr(), rb_enc_uint_chr(), rb_io_each_codepoint(), rb_io_getline_1(), rb_reg_expr_str(), rb_str_coderange_scan_restartable(), rb_str_concat(), rb_str_dump(), rb_str_inspect(), rb_str_succ(), unescape_escaped_nonascii(), and unescape_nonascii().
| VALUE rb_enc_reg_new | ( | const char * | , |
| long | , | ||
| rb_encoding * | , | ||
| int | |||
| ) |
Definition at line 2511 of file re.c.
References err, NULL, rb_enc_reg_raise(), rb_reg_alloc(), and rb_reg_initialize().
| int rb_enc_replicate | ( | const char * | , |
| rb_encoding * | |||
| ) |
Definition at line 343 of file encoding.c.
References enc_check_duplication(), enc_register(), rb_enc_from_index(), set_base_encoding(), and set_encoding_const().
Referenced by enc_replicate(), and rb_define_dummy_encoding().
| void rb_enc_set_default_external | ( | VALUE | encoding | ) |
Definition at line 1338 of file encoding.c.
References enc_set_default_encoding(), NIL_P, rb_eArgError, and rb_raise().
Referenced by process_options(), and set_default_external().
| void rb_enc_set_default_internal | ( | VALUE | encoding | ) |
Definition at line 1424 of file encoding.c.
References enc_set_default_encoding().
Referenced by process_options(), and set_default_internal().
| void rb_enc_set_index | ( | VALUE | obj, |
| int | encindex | ||
| ) |
Definition at line 739 of file encoding.c.
References enc_set_index(), and rb_check_frozen.
Referenced by pack_pack(), and str_enc_copy().
| int rb_enc_str_asciionly_p | ( | VALUE | ) |
Definition at line 340 of file string.c.
References ENC_CODERANGE_7BIT, FALSE, rb_enc_asciicompat, rb_enc_str_coderange(), STR_ENC_GET, and TRUE.
| VALUE rb_enc_str_buf_cat | ( | VALUE | str, |
| const char * | ptr, | ||
| long | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 2067 of file string.c.
References ENC_CODERANGE_UNKNOWN, NULL, rb_enc_cr_str_buf_cat(), and rb_enc_to_index.
| int rb_enc_str_coderange | ( | VALUE | ) |
Definition at line 327 of file string.c.
References coderange_scan(), ENC_CODERANGE, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
| VALUE rb_enc_str_new | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 439 of file string.c.
References rb_enc_associate(), and rb_str_new().
| long rb_enc_strlen | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
Definition at line 1025 of file string.c.
References ENC_CODERANGE_UNKNOWN, and enc_strlen().
| int rb_enc_symname2_p | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 15804 of file ripper.c.
References rb_enc_symname_type().
Referenced by rb_enc_symname_p(), rb_mod_const_get(), and reg_named_capture_assign_iter().
| int rb_enc_symname_p | ( | const char * | , |
| rb_encoding * | |||
| ) |
Definition at line 15703 of file ripper.c.
References rb_enc_symname2_p(), and strlen().
Referenced by rb_str_symname_p(), and rb_symname_p().
| int rb_enc_tolower | ( | int | c, |
| rb_encoding * | enc | ||
| ) |
Definition at line 968 of file encoding.c.
References ONIGENC_ASCII_CODE_TO_LOWER_CASE, and ONIGENC_IS_ASCII_CODE.
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), and rb_str_swapcase_bang().
| int rb_enc_toupper | ( | int | c, |
| rb_encoding * | enc | ||
| ) |
Definition at line 962 of file encoding.c.
References ONIGENC_ASCII_CODE_TO_UPPER_CASE, and ONIGENC_IS_ASCII_CODE.
Referenced by bracket(), fnmatch_helper(), rb_str_capitalize_bang(), rb_str_format(), rb_str_swapcase_bang(), and rb_str_upcase_bang().
| VALUE rb_enc_uint_chr | ( | unsigned int | code, |
| rb_encoding * | enc | ||
| ) |
Definition at line 2417 of file numeric.c.
References ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_eRangeError, rb_raise(), RSTRING_END, and RSTRING_PTR.
| int rb_enc_unicode_p | ( | rb_encoding * | enc | ) |
Definition at line 459 of file encoding.c.
References ONIGENC_IS_UNICODE.
Referenced by rb_reg_expr_str(), and rb_str_inspect().
| VALUE rb_enc_vsprintf | ( | rb_encoding * | , |
| const char * | , | ||
| va_list | |||
| ) |
Definition at line 1218 of file sprintf.c.
References __SSTR, __SWR, BSD_vfprintf(), f, rb_cString, rb_eArgError, rb_enc_associate(), rb_enc_mbminlen, rb_enc_name, rb_raise(), rb_str_buf_new(), rb_str_resize(), RBASIC, result, RSTRING_PTR, ruby__sfvextra(), ruby__sfvwrite(), and rb_printf_buffer_extra::value.
Definition at line 804 of file eval.c.
References rb_thread_struct::errinfo, EXEC_TAG, GET_THREAD(), JUMP_TAG, POP_TAG, PUSH_TAG, Qnil, and result.
Referenced by _thread_call_proc(), check_autoload_required(), dir_entries(), dir_foreach(), dir_s_chdir(), dir_s_open(), fdbm_s_open(), fgdbm_s_open(), fole_each(), fsdbm_s_open(), gzfile_reader_end(), gzfile_wrap(), gzfile_writer_end(), io_s_write(), lib_eventloop_launcher(), lib_mainloop_watchdog(), load_file(), mSyslog_open(), p_gid_switch(), p_uid_switch(), pipe_pair_close(), pty_getpty(), pty_open(), rb_autoload_load(), rb_deflate_s_deflate(), rb_dlhandle_initialize(), rb_f_open(), rb_f_select(), rb_fiddle_handle_initialize(), rb_gvar_set(), rb_hash_foreach(), rb_inflate_s_inflate(), rb_io_s_binread(), rb_io_s_copy_stream(), rb_io_s_foreach(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_io_s_read(), rb_io_s_readlines(), rb_mutex_sleep(), rb_mutex_synchronize(), rb_objspace_each_objects(), rb_uninterruptible(), rb_wait_for_single_fd(), rsock_init_inetsock(), rsock_make_hostent(), strio_s_open(), thread_join(), tracepoint_disable_m(), tracepoint_enable_m(), and udp_connect().
Definition at line 33 of file enum.c.
References Qnil, and rb_ary_new4().
Referenced by collect_all(), drop_i(), each_with_index_i(), lazy_grep_func(), lazy_grep_iter(), lazy_reject_func(), lazy_select_func(), member_i(), take_i(), take_while_i(), zip_ary(), and zip_i().
Definition at line 398 of file enumerator.c.
References rb_enumeratorize_with_size().
Referenced by argf_bytes(), argf_chars(), argf_codepoints(), argf_lines(), rb_gzreader_bytes(), rb_gzreader_lines(), rb_io_bytes(), rb_io_chars(), rb_io_codepoints(), rb_io_lines(), strio_bytes(), strio_chars(), strio_codepoints(), and strio_lines().
Definition at line 407 of file enumerator.c.
References enumerator_allocate(), enumerator_init(), lazy_to_enum_i(), Qnil, rb_cEnumerator, rb_cLazy, rb_obj_is_kind_of(), RTEST, and enumerator::size_fn.
Referenced by obj_to_enum(), and rb_enumeratorize().
| VALUE rb_env_clear | ( | void | ) |
Definition at line 2859 of file hash.c.
References env_delete(), env_keys(), envtbl, i, NIL_P, Qnil, RARRAY_LEN, RARRAY_PTR, rb_f_getenv(), and val.
| int rb_env_path_tainted | ( | void | ) |
Definition at line 2329 of file hash.c.
References getenv(), PATH_ENV, path_tainted, and path_tainted_p().
Definition at line 67 of file object.c.
References id_eql, rb_funcall(), and RTEST.
| VALUE rb_errinfo | ( | void | ) |
Definition at line 1429 of file eval.c.
References rb_thread_struct::errinfo, and GET_THREAD().
| void rb_error_untrusted | ( | VALUE | ) |
Definition at line 1985 of file error.c.
References rb_eSecurityError, rb_obj_classname(), rb_raise(), and rb_safe_level.
Definition at line 1444 of file vm_eval.c.
References eval_string(), EXEC_TAG, JUMP_TAG, OBJ_TAINTED, POP_TAG, PUSH_TAG, Qnil, RARRAY_LENINT, RARRAY_PTR, rb_funcall2(), rb_intern, rb_safe_level, rb_set_safe_level_force(), RB_TYPE_P, rb_vm_top_self(), and T_STRING.
Evaluates the given string in an isolated binding.
Here "isolated" means the binding does not inherit any other binding. This behaves same as the binding for required libraries.
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
| str | Ruby code to evaluate. |
| Exception | Raises an exception on error. |
Definition at line 1384 of file vm_eval.c.
References ruby_eval_string_from_file().
Evaluates the given string in an isolated binding.
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
| str | Ruby code to evaluate. |
| state | Being set to zero if succeeded. Nonzero if an error occurred. |
Definition at line 1400 of file vm_eval.c.
References rb_eval_string(), and rb_protect().
Evaluates the given string under a module binding in an isolated binding.
This is same as the binding for required libraries on "require('foo', true)".
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
| str | Ruby code to evaluate. |
| state | Being set to zero if succeeded. Nonzero if an error occurred. |
Definition at line 1417 of file vm_eval.c.
References GET_THREAD(), JUMP_TAG, rb_eval_string_protect(), rb_extend_object(), rb_module_new(), rb_obj_clone(), rb_vm_top_self(), rb_thread_struct::top_self, and rb_thread_struct::top_wrapper.
Definition at line 536 of file error.c.
References rb_funcall(), rb_intern, and rb_str_new().
Referenced by ossl_make_error(), rb_exc_new2(), rb_threadptr_raise(), and setup_exception().
Definition at line 542 of file error.c.
References rb_exc_new(), and strlen().
Referenced by compile_err_append(), create_ip_exc(), fiber_switch(), gzfile_raise(), Init_Thread(), ip_create_slave_core(), ip_eval_real(), ip_get_variable2_core(), ip_invoke_core(), ip_make_safe_core(), ip_rb_threadTkWaitCommand(), ip_rb_threadUpdateCommand(), ip_rb_threadVwaitCommand(), ip_rbTkWaitCommand(), ip_rbUpdateCommand(), ip_rbVwaitCommand(), ip_ruby_cmd(), ip_ruby_eval(), ip_RubyExitCommand(), ip_set_variable2_core(), lib_eventloop_core(), lib_eventloop_main(), lib_restart_core(), make_localjump_error(), next_i(), raise_from_check(), raise_zlib_error(), tcl_protect_core(), and tcltkip_init_tk().
Definition at line 548 of file error.c.
References rb_funcall(), rb_intern, and StringValue.
Referenced by cannot_be_coerced_into_BigDecimal(), compile_err_append(), finish_writeconv(), Init_eval(), Init_GC(), Init_Proc(), ip_eval(), ip_invoke_with_position(), make_econv_exception(), make_exception(), raise_loaderror(), rand_random(), rb_arg_error_new(), rb_econv_open_exc(), rb_enc_raise(), rb_enc_reg_error_desc(), rb_fatal(), rb_raise(), tcl_protect_core(), and tk_funcall().
| int rb_exec_async_signal_safe | ( | const struct rb_execarg * | e, |
| char * | errmsg, | ||
| size_t | errmsg_buflen | ||
| ) |
Definition at line 3019 of file process.c.
References after_exec_async_signal_safe(), before_exec_async_signal_safe(), rb_execarg::cmd, rb_execarg::envp_str, rb_execarg::invoke, NIL_P, NULL, preserving_errno, proc_exec_cmd(), proc_exec_sh(), rb_execarg_run_options(), RSTRING_PTR, rb_execarg::sh, and rb_execarg::use_shell.
| void rb_exec_end_proc | ( | void | ) |
Definition at line 97 of file eval_jump.c.
References end_proc_data::data, end_procs, ephemeral_end_procs, rb_thread_struct::errinfo, error_handle(), EXEC_TAG, end_proc_data::func, GET_THREAD(), link(), end_proc_data::next, NIL_P, POP_TAG, PUSH_TAG, rb_safe_level, rb_set_safe_level_force(), end_proc_data::safe, and xfree.
Referenced by ruby_finalize_0().
Definition at line 4857 of file thread.c.
References exec_recursive(), and func.
Definition at line 4880 of file thread.c.
References exec_recursive(), and func.
Definition at line 4868 of file thread.c.
References exec_recursive(), func, and rb_obj_id().
Definition at line 1606 of file process.c.
References rb_execarg::chdir_dir, rb_execarg::chdir_given, check_exec_redirect(), check_gid_switch(), check_uid_switch(), rb_execarg::close_others_do, rb_execarg::close_others_given, FilePathValue, rb_execarg::gid, rb_execarg::gid_given, hide_obj(), id, INT2FIX, INT2NUM, mode_t, rb_execarg::new_pgroup_flag, rb_execarg::new_pgroup_given, NIL_P, NUM2MODET, NUM2PIDT, OBJ2GID, OBJ2UID, rb_execarg::pgroup_given, rb_execarg::pgroup_pgid, PREPARE_GETGRNAM, PREPARE_GETPWNAM, Qfalse, Qtrue, RARRAY_LEN, rb_ary_entry(), rb_ary_new(), rb_ary_new3(), rb_ary_push(), rb_check_array_type(), rb_eArgError, rb_eNotImpError, rb_execarg_get(), RB_GC_GUARD, rb_id2name(), rb_intern, rb_raise(), rb_secure(), rb_str_dup(), rb_to_int(), rb_execarg::rlimit_limits, RTEST, ST_CONTINUE, ST_STOP, SYM2ID, T_ARRAY, T_FILE, T_FIXNUM, T_SYMBOL, TYPE, rb_execarg::uid, rb_execarg::uid_given, rb_execarg::umask_given, rb_execarg::umask_mask, rb_execarg::unsetenv_others_do, and rb_execarg::unsetenv_others_given.
Definition at line 1897 of file process.c.
References args, check_exec_options_i_extract(), Qnil, RHASH_EMPTY_P, RHASH_TBL, and st_foreach().
| void rb_execarg_fixup | ( | VALUE | execarg_obj | ) |
Definition at line 2254 of file process.c.
References check_exec_fds(), rb_execarg::dup2_tmpbuf, rb_execarg::env_modification, rb_execarg::envp_buf, rb_execarg::envp_str, envtbl, rb_execarg::fd_dup2, fill_envp_buf_i(), hide_obj(), i, key, NIL_P, NULL, p, Qfalse, RARRAY_LEN, RARRAY_PTR, rb_cObject, rb_const_get(), rb_convert_type(), rb_execarg_get(), RB_GC_GUARD, rb_hash_new(), rb_intern, rb_str_buf_cat(), rb_str_buf_new(), rb_str_new(), rb_str_set_len(), rb_execarg::redirect_fds, RHASH_SIZE, RHASH_TBL, RSTRING_LEN, RSTRING_PTR, run_exec_dup2_tmpbuf_size(), st_delete(), st_foreach(), st_insert(), strlen(), T_HASH, tmpbuf, rb_execarg::unsetenv_others_do, rb_execarg::unsetenv_others_given, and val.
|
read |
Definition at line 2201 of file process.c.
References exec_arg_data_type, and TypedData_Get_Struct.
Definition at line 2209 of file process.c.
References rb_execarg::cmd, env, rb_execarg::invoke, Qnil, rb_exec_fillarg(), rb_exec_getargs(), rb_execarg_get(), RB_GC_GUARD, rb_execarg::sh, and rb_execarg::use_shell.
Definition at line 2190 of file process.c.
References exec_arg_data_type, hide_obj(), rb_cData, rb_execarg_init(), and TypedData_Make_Struct.
| int rb_execarg_run_options | ( | const struct rb_execarg * | e, |
| struct rb_execarg * | s, | ||
| char * | errmsg, | ||
| size_t | errmsg_buflen | ||
| ) |
Definition at line 2872 of file process.c.
References rb_execarg::chdir_dir, rb_execarg::chdir_given, rb_execarg::close_others_do, rb_execarg::close_others_given, rb_execarg::close_others_maxhint, rb_execarg::dup2_tmpbuf, rb_execarg::env_modification, ERRMSG, rb_execarg::fd_close, rb_execarg::fd_dup2, rb_execarg::fd_dup2_child, rb_execarg::fd_open, rb_execarg::gid, rb_execarg::gid_given, hide_obj(), i, key, MEMZERO, mode_t, my_getcwd, NIL_P, rb_execarg::pgroup_given, Qfalse, Qnil, RARRAY_LEN, RARRAY_PTR, rb_close_before_exec(), rb_env_clear(), rb_str_new(), rb_str_new2, rb_str_set_len(), rb_warn(), rb_execarg::redirect_fds, rb_execarg::rlimit_limits, RSTRING_PTR, ruby_setenv(), run_exec_close(), run_exec_dup2(), run_exec_dup2_child(), run_exec_dup2_tmpbuf_size(), run_exec_open(), save_env(), setgid(), setuid(), StringValueCStr, tmpbuf, rb_execarg::uid, rb_execarg::uid_given, umask(), rb_execarg::umask_given, rb_execarg::umask_mask, rb_execarg::unsetenv_others_do, rb_execarg::unsetenv_others_given, val, and xfree.
Definition at line 2228 of file process.c.
References rb_execarg::env_modification, NIL_P, Qfalse, rb_check_exec_env(), and rb_execarg_get().
Definition at line 1234 of file eval.c.
References rb_include_module(), and rb_singleton_class().
Referenced by append_extmod(), Init_etc(), Init_Hash(), Init_readline(), mSyslogMacros_included(), r_object0(), rb_eval_string_wrap(), rb_load_internal(), rb_mod_extend_object(), rb_mod_sys_fail(), rb_mod_sys_fail_str(), rb_mod_syserr_fail(), rb_mod_syserr_fail_str(), read_would_block(), and write_would_block().
Definition at line 584 of file string.c.
References rb_default_external_encoding(), and rb_external_str_new_with_enc().
Definition at line 590 of file string.c.
References rb_default_external_encoding(), rb_external_str_new_with_enc(), and strlen().
| VALUE rb_external_str_new_with_enc | ( | const char * | ptr, |
| long | len, | ||
| rb_encoding * | |||
| ) |
Definition at line 569 of file string.c.
References ENC_CODERANGE_7BIT, rb_ascii8bit_encoding(), rb_default_internal_encoding(), rb_enc_associate(), rb_enc_str_coderange(), rb_str_conv_enc(), rb_tainted_str_new(), and rb_usascii_encoding().
Definition at line 3620 of file process.c.
References args, EXIT_FAILURE, GET_THREAD(), INT2NUM, NIL_P, rb_class_new_instance(), rb_eSystemExit, rb_exc_raise(), rb_exit(), rb_io_puts(), rb_scan_args(), rb_secure(), rb_stderr, ruby_error_print(), StringValue, and UNREACHABLE.
Definition at line 2387 of file process.c.
References CHILD_ERRMSG_BUFLEN, rb_execarg::cmd, rb_execarg::invoke, Qnil, rb_exec_async_signal_safe(), rb_exec_without_timer_thread(), rb_execarg_fixup(), rb_execarg_get(), rb_execarg_new(), RB_GC_GUARD, rb_sys_fail(), rb_sys_fail_str(), rb_execarg::sh, TRUE, and rb_execarg::use_shell.
Definition at line 3590 of file process.c.
References exit_status_code(), EXIT_SUCCESS, rb_exit(), rb_scan_args(), rb_secure(), and UNREACHABLE.
| VALUE rb_f_global_variables | ( | void | ) |
Definition at line 842 of file variable.c.
References buf, gvar_i(), i, ID2SYM, rb_ary_new(), rb_ary_push(), rb_intern2(), and st_foreach_safe().
Definition at line 364 of file signal.c.
References argc, FIX2INT, i, INT2FIX, kill(), killpg, NIL_P, NUM2PIDT, rb_check_arity, rb_check_string_type(), rb_eArgError, rb_id2name(), rb_obj_classname(), rb_raise(), rb_secure(), rb_sys_fail(), RSTRING_PTR, signm2signo(), SYM2ID, T_FIXNUM, T_STRING, T_SYMBOL, TYPE, and UNLIMITED_ARGUMENTS.
Definition at line 70 of file vm_method.c.
References rb_notimplement(), and UNREACHABLE.
Definition at line 786 of file load.c.
References rb_require_safe(), and rb_safe_level.
Definition at line 433 of file sprintf.c.
References GETNTHARG, and rb_str_format().
Definition at line 641 of file variable.c.
References ALLOC, trace_var::data, trace_var::func, global_entry, trace_var::next, NIL_P, OBJ_TAINTED, Qnil, rb_block_proc(), rb_eSecurityError, rb_f_untrace_var(), rb_global_entry(), rb_raise(), rb_scan_args(), rb_secure(), rb_to_id(), rb_trace_eval(), and trace_var::removed.
Definition at line 701 of file variable.c.
References trace_var::data, global_entry, id, trace_var::next, NIL_P, PRIsVALUE, Qnil, QUOTE, QUOTE_ID, rb_ary_new(), rb_ary_new3(), rb_ary_push(), rb_check_id(), rb_name_error(), rb_name_error_str(), rb_scan_args(), rb_secure(), remove_trace(), trace_var::removed, and st_lookup().
| void rb_fd_fix_cloexec | ( | int | fd | ) |
Definition at line 202 of file io.c.
References rb_maygvl_fd_fix_cloexec(), and rb_update_max_fd().
Definition at line 511 of file load.c.
References FALSE, IS_DLEXT, IS_RBEXT, IS_SOEXT, Qnil, rb_feature_p(), rb_file_expand_path_fast(), rb_get_path(), rb_str_new2, RSTRING_PTR, strchr(), strrchr(), and TRUE.
Definition at line 1392 of file cont.c.
References GetFiberPtr, Qfalse, Qtrue, rb_fiber_struct::status, and TERMINATED.
Referenced by get_next_values(), and ruby_Init_Fiber_as_Coroutine().
| VALUE rb_fiber_current | ( | void | ) |
Definition at line 1200 of file cont.c.
References rb_fiber_struct::cont, rb_thread_struct::fiber, GET_THREAD(), rb_thread_struct::root_fiber, root_fiber_alloc(), and rb_context_struct::self.
Referenced by fiber_link_join(), fiber_switch(), get_next_values(), next_init(), rb_fiber_s_current(), and return_fiber().
Definition at line 1090 of file cont.c.
References fiber_alloc(), fiber_init(), func, rb_cFiber, and rb_proc_new().
Referenced by next_init().
| void rb_fiber_reset_root_local_storage | ( | VALUE | ) |
Definition at line 1370 of file cont.c.
References rb_fiber_struct::cont, rb_thread_struct::fiber, GetFiberPtr, GetThreadPtr, rb_thread_struct::local_storage, rb_thread_struct::root_fiber, and rb_context_struct::saved_thread.
Referenced by ruby_vm_destruct().
Definition at line 1348 of file cont.c.
References rb_fiber_struct::cont, fiber_switch(), GetFiberPtr, rb_fiber_struct::prev, Qnil, rb_eFiberError, rb_raise(), ROOT_FIBER_CONTEXT, rb_fiber_struct::transfered, and rb_context_struct::type.
Referenced by get_next_values(), and rb_fiber_m_resume().
Definition at line 1364 of file cont.c.
References rb_fiber_transfer(), and return_fiber().
Referenced by next_i(), next_ii(), and rb_fiber_s_yield().
Definition at line 3357 of file file.c.
References check_expand_path_args, EXPAND_PATH_BUFFER, and rb_file_expand_path_internal().
Definition at line 5144 of file file.c.
References rb_define_const().
Definition at line 3792 of file file.c.
References FilePathStringValue, isdirsep, name, OBJ_INFECT, p, rb_enc_copy(), rb_enc_get(), rb_str_cat(), rb_str_new(), rb_usascii_str_new2, skipprefix, skiproot(), StringValueCStr, strrdirsep, and top.
Definition at line 3314 of file file.c.
References check_expand_path_args, EXPAND_PATH_BUFFER, and rb_file_expand_path_internal().
Definition at line 3321 of file file.c.
References EXPAND_PATH_BUFFER, and rb_file_expand_path_internal().
Definition at line 2960 of file file.c.
References ALLOCA_N, ALLOCV_END, ALLOCV_N, append_fspath(), buf, BUFCHECK, BUFINIT, chompdirsep(), code_page(), convert_mb_to_wchar(), ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, fix_string_encoding(), get_user_from_path(), home_dir(), Inc, INVALID_CODE_PAGE, IS_DIR_SEPARATOR_P, IS_DIR_UNC_P, isdirsep, istrailinggarbage, RString::len, lstat, MAXPATHLEN, my_getcwd, nextdirsep, NIL_P, NULL, OBJ_TAINT, OBJ_TAINTED, p, PATH_BUFFER_SIZE, Qnil, rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_copy(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_str_coderange(), rb_file_expand_path_internal(), rb_filesystem_encoding(), rb_home_dir(), rb_is_absolute_path(), rb_raise(), rb_str_buf_cat(), rb_str_encode(), rb_str_encode_ospath(), rb_str_modify(), rb_str_resize(), rb_str_set_len(), rb_utf8_encoding(), remove_invalid_alternative_data(), replace_to_long_name(), replace_wchar(), result, RSTRING_LEN, RSTRING_PTR, S_ISLNK, size, skipprefix, skiproot(), stat, STRCASECMP, StringValuePtr, strlcat(), strlen(), strncasecmp, strrdirsep, system_code_page(), TOLOWER, v, xfree, and xmalloc.
| int rb_file_load_ok | ( | const char * | ) |
Definition at line 5260 of file file.c.
References PepperInstance::as_int, PepperInstance::async_call_args, PepperInstance::async_call_result, PepperInstance::cond, core_interface, fstat, GET_PEPPER_INSTANCE, PepperInstance::instance, INVALID_FILE_ATTRIBUTES, load_ok_internal(), PepperInstance::mutex, NULL, pruby_file_fetch_check_response(), rb_cloexec_open(), rb_update_max_fd(), S_ISREG, and stat.
Definition at line 5424 of file io.c.
References io_alloc(), rb_cFile, rb_file_open_internal(), and rb_str_new_cstr().
Definition at line 5417 of file io.c.
References FilePathValue, io_alloc(), rb_cFile, and rb_file_open_internal().
Definition at line 3377 of file file.c.
References Qnil, rb_file_absolute_path(), and rb_scan_args().
Definition at line 3344 of file file.c.
References Qnil, rb_file_expand_path(), and rb_scan_args().
| int rb_filesystem_encindex | ( | void | ) |
Definition at line 1237 of file encoding.c.
References rb_ascii8bit_encindex(), and rb_enc_registered().
Referenced by rb_filesystem_encoding().
| rb_encoding* rb_filesystem_encoding | ( | void | ) |
Definition at line 1246 of file encoding.c.
References rb_enc_from_index(), and rb_filesystem_encindex().
Referenced by coverage(), debug_lines(), dir_initialize(), env_fetch(), etc_systmpdir(), file_path_convert(), gettable_gen(), push_glob(), rb_dir_getwd(), rb_f_getenv(), rb_file_expand_path_internal(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_home_dir(), rb_str_encode_ospath(), and rb_w32_special_folder().
Definition at line 608 of file string.c.
References rb_external_str_new_with_enc(), and rb_filesystem_encoding().
Definition at line 614 of file string.c.
References rb_external_str_new_with_enc(), rb_filesystem_encoding(), and strlen().
| rb_encoding* rb_find_encoding | ( | VALUE | ) |
Definition at line 201 of file encoding.c.
References enc_check_encoding(), NULL, rb_enc_from_index(), RDATA, and str_find_encindex().
Referenced by find_encoding().
Definition at line 5371 of file file.c.
References rb_find_file_safe(), and rb_safe_level.
Definition at line 5296 of file file.c.
References rb_find_file_ext_safe(), and rb_safe_level.
Definition at line 5302 of file file.c.
References copy_path_class(), file_expand_path_1(), FL_TAINT, FL_UNSET, FL_UNTRUSTED, fpath_check, i, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_LEN, RARRAY_PTR, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_expanded_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_cat2(), rb_str_dup(), rb_str_set_len(), rb_str_tmp_new(), rb_usascii_encindex(), RBASIC, RSTRING_PTR, and StringValueCStr.
Definition at line 5377 of file file.c.
References copy_path_class(), file_expand_path_1(), fpath_check, i, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_LEN, RARRAY_PTR, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_expanded_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_tmp_new(), rb_usascii_encindex(), RSTRING_PTR, and StringValueCStr.
| short rb_fix2short | ( | VALUE | ) |
Definition at line 2143 of file numeric.c.
References check_short(), FIX2LONG, FIXNUM_P, and rb_num2long().
Definition at line 2546 of file numeric.c.
References buf, CHAR_BIT, FIX2LONG, neg, rb_eArgError, rb_raise(), rb_usascii_str_new2, ruby_digitmap, and SIZEOF_VALUE.
| unsigned short rb_fix2ushort | ( | VALUE | ) |
Definition at line 2161 of file numeric.c.
References check_ushort(), FIX2ULONG, FIXNUM_P, negative_int_p(), and rb_num2ushort().
Definition at line 2628 of file object.c.
References DBL2NUM, FIX2LONG, rb_big2dbl(), rb_convert_type(), rb_eTypeError, rb_raise(), rb_str_to_dbl(), T_BIGNUM, T_FIXNUM, T_FLOAT, T_NIL, T_STRING, TRUE, TYPE, and UNREACHABLE.
|
inlinestatic |
Definition at line 790 of file ruby.h.
References rb_float_new_in_heap(), RUBY_BIT_ROTL, and v.
| VALUE rb_float_new_in_heap | ( | double | ) |
|
inlinestatic |
Definition at line 764 of file ruby.h.
References FLONUM_P, RUBY_BIT_ROTR, and v.
| rb_pid_t rb_fork_async_signal_safe | ( | int * | status, |
| int(*)(void *, char *, size_t) | chfunc, | ||
| void * | charg, | ||
| VALUE | fds, | ||
| char * | errmsg, | ||
| size_t | errmsg_buflen | ||
| ) |
| rb_pid_t rb_fork_ruby | ( | int * | status | ) |
| ID rb_frame_callee | ( | void | ) |
Definition at line 919 of file eval.c.
References frame_called_id(), GET_THREAD(), and previous_frame().
Referenced by error_pos(), rb_f_callee_name(), rb_insecure_operation(), rb_secure(), and set_method_visibility().
Definition at line 1489 of file vm.c.
References GET_THREAD(), and rb_thread_method_id_and_class().
| void rb_frame_pop | ( | void | ) |
Definition at line 935 of file eval.c.
References rb_thread_struct::cfp, GET_THREAD(), and RUBY_VM_PREVIOUS_CONTROL_FRAME.
Referenced by rb_mod_const_missing().
| ID rb_frame_this_func | ( | void | ) |
Definition at line 902 of file eval.c.
References frame_func_id(), and GET_THREAD().
Referenced by argf_forward(), lazy_set_method(), rb_iterate(), rb_notimplement(), rb_struct_ref(), rb_struct_set(), recursive_list_access(), recursive_pop(), and set_const_visibility().
| void rb_free_generic_ivar | ( | VALUE | ) |
Definition at line 1023 of file variable.c.
References key, st_delete(), and st_free_table().
| void rb_free_tmp_buffer | ( | volatile VALUE * | store | ) |
Definition at line 822 of file string.c.
References rb_str_clear().
| void rb_frozen_class_p | ( | VALUE | ) |
Definition at line 403 of file eval.c.
References FL_SINGLETON, FL_TEST, OBJ_FROZEN, rb_error_frozen(), T_CLASS, T_ICLASS, T_MODULE, and TYPE.
Referenced by rb_alias(), rb_include_module(), rb_prepend_module(), and rb_undef().
Calls a method.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| n | the number of arguments |
| ... | arbitrary number of method arguments |
Definition at line 774 of file vm_eval.c.
References ALLOCA_N, argv, CALL_FCALL, i, rb_call(), and va_init_list.
Calls a method.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| argc | the number of arguments |
| argv | pointer to an array of method arguments |
Definition at line 805 of file vm_eval.c.
References CALL_FCALL, and rb_call().
Calls a method.
Same as rb_funcall2 but this function can call only public methods.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| argc | the number of arguments |
| argv | pointer to an array of method arguments |
Definition at line 820 of file vm_eval.c.
References CALL_PUBLIC, and rb_call().
Definition at line 826 of file vm_eval.c.
References CALL_PUBLIC, GET_THREAD(), PASS_PASSED_BLOCK_TH, and rb_call().
Definition at line 834 of file vm_eval.c.
References rb_proc_t::block, CALL_PUBLIC, GET_THREAD(), GetProcPtr, NIL_P, rb_thread_struct::passed_block, and rb_call().
| void rb_gc | ( | void | ) |
Definition at line 3108 of file gc.c.
References finalize_deferred(), finalizing, free_unused_heaps(), garbage_collect(), and rb_objspace.
| void rb_gc_call_finalizer_at_exit | ( | void | ) |
Definition at line 1482 of file gc.c.
References rb_objspace_call_finalizer().
Definition at line 1349 of file gc.c.
References finalizer_table, FL_FINALIZE, FL_SET, FL_TEST, rb_objspace, st_insert(), and st_lookup().
| VALUE rb_gc_disable | ( | void | ) |
| VALUE rb_gc_enable | ( | void | ) |
| void rb_gc_finalize_deferred | ( | void | ) |
Definition at line 1455 of file gc.c.
References ATOMIC_EXCHANGE, ATOMIC_SET, finalize_deferred(), finalizing, and rb_objspace.
| void rb_gc_force_recycle | ( | VALUE | ) |
Definition at line 2961 of file gc.c.
References add_slot_local_freelist(), heaps_slot::free_next, rb_objspace::free_num, GET_HEAP_BITMAP, rb_objspace::heap, link_free_heap_slot(), MARKED_IN_BITMAP, NULL, rb_objspace, and rb_objspace::total_freed_object_num.
| void rb_gc_mark_encodings | ( | void | ) |
Definition at line 211 of file encoding.c.
Referenced by gc_marks().
| void rb_gc_mark_global_tbl | ( | void | ) |
Definition at line 547 of file variable.c.
References mark_global_entry(), and st_foreach_safe().
Definition at line 2341 of file gc.c.
References gc_mark_locations().
| void rb_gc_mark_maybe | ( | VALUE | ) |
Definition at line 2547 of file gc.c.
References gc_mark(), and is_pointer_to_heap().
| void rb_gc_mark_parser | ( | void | ) |
Definition at line 15480 of file ripper.c.
Referenced by gc_marks().
| void rb_gc_mark_symbols | ( | void | ) |
Definition at line 15653 of file ripper.c.
References global_symbols, symbols::id_str, numberof, symbols::op_sym, rb_gc_mark_locations, and rb_mark_tbl().
Referenced by gc_marks().
| void rb_gc_register_address | ( | VALUE * | ) |
Definition at line 2987 of file gc.c.
References ALLOC, global_List, gc_list::next, rb_objspace, and gc_list::varptr.
| void rb_gc_register_mark_object | ( | VALUE | ) |
Definition at line 2980 of file gc.c.
References GET_THREAD(), rb_vm_struct::mark_object_ary, rb_ary_push(), and rb_thread_struct::vm.
| void rb_gc_set_params | ( | void | ) |
Definition at line 3293 of file gc.c.
References getenv(), initial_expand_heap(), initial_free_min, initial_heap_min_slots, initial_malloc_limit, NULL, rb_safe_level, RTEST, and ruby_verbose.
| void rb_gc_unregister_address | ( | VALUE * | ) |
Definition at line 2999 of file gc.c.
References global_List, gc_list::next, rb_objspace, gc_list::varptr, and xfree.
Definition at line 899 of file variable.c.
References FL_EXIVAR, FL_TEST, and st_lookup().
| unsigned int rb_genrand_int32 | ( | void | ) |
Definition at line 250 of file random.c.
References default_mt(), and genrand_int32().
| double rb_genrand_real | ( | void | ) |
Definition at line 257 of file random.c.
References default_mt(), and genrand_real().
| unsigned long rb_genrand_ulong_limited | ( | unsigned long | i | ) |
Definition at line 908 of file random.c.
References default_mt(), and limited_rand().
| rb_alloc_func_t rb_get_alloc_func | ( | VALUE | ) |
Definition at line 488 of file vm_method.c.
References Check_Type, RCLASS_EXT, RCLASS_SUPER, T_CLASS, and UNDEF_ALLOC_FUNC.
Definition at line 53 of file eval_error.c.
References get_backtrace().
Referenced by eval_string_with_cref().
| VALUE rb_get_expanded_load_path | ( | void | ) |
Definition at line 110 of file load.c.
References EXPAND_ALL, EXPAND_HOME, EXPAND_NON_CACHE, EXPAND_RELATIVE, rb_vm_struct::expanded_load_path, GET_VM, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, load_path_getcwd(), rb_vm_struct::load_path_snapshot, Qtrue, rb_ary_shared_with_p(), rb_construct_expanded_load_path(), and rb_str_equal().
| int rb_get_next_signal | ( | void | ) |
Definition at line 590 of file signal.c.
References ATOMIC_DEC, i, RUBY_NSIG, and signal_buff.
Definition at line 224 of file file.c.
References rb_get_path_check(), and rb_safe_level.
Definition at line 197 of file file.c.
References check_path_encoding(), file_path_convert(), insecure_obj_p, rb_insecure_operation(), rb_str_new4, and StringValueCStr.
Definition at line 175 of file file.c.
References CONST_ID, insecure_obj_p, Qundef, rb_check_funcall(), rb_insecure_operation(), RB_TYPE_P, StringValue, and T_STRING.
Definition at line 218 of file file.c.
References rb_get_path_check().
Definition at line 2580 of file array.c.
References argc, FIX2LONG, FIXNUM_P, func, i, NUM2LONG, RARRAY_LEN, rb_ary_new2(), rb_ary_push(), rb_ary_resize(), rb_range_beg_len(), and result.
Referenced by match_values_at(), rb_ary_values_at(), and rb_struct_values_at().
| VALUE rb_gets | ( | void | ) |
Definition at line 7877 of file io.c.
References ARGF, next_argv, NIL_P, Qnil, rb_default_rs, rb_f_gets(), rb_io_close(), rb_io_gets(), rb_lastline_set(), and rb_rs.
Definition at line 1574 of file dir.c.
References func, GLOB_JUMP_TAG, rb_ascii8bit_encoding(), and rb_glob2().
|
read |
Definition at line 435 of file variable.c.
References ALLOC, global_variable::block_trace, global_variable::counter, global_variable::data, global_variable::getter, global_entry, id, global_variable::marker, global_variable::setter, st_add_direct(), st_lookup(), global_variable::trace, undef_getter, undef_marker, and undef_setter.
| void rb_global_variable | ( | VALUE * | ) |
Definition at line 426 of file gc.c.
References rb_gc_register_address().
Definition at line 808 of file variable.c.
References global_entry, global_id(), rb_global_entry(), and rb_gvar_get().
Definition at line 799 of file variable.c.
References global_entry, global_id(), rb_global_entry(), and rb_gvar_set().
| VALUE rb_gvar_defined | ( | struct rb_global_entry * | ) |
| VALUE rb_gvar_get | ( | struct rb_global_entry * | ) |
| void rb_gvar_readonly_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| VALUE rb_gvar_set | ( | struct rb_global_entry * | , |
| VALUE | |||
| ) |
| VALUE rb_gvar_undef_getter | ( | ID | id, |
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| void rb_gvar_undef_marker | ( | VALUE * | var | ) |
| void rb_gvar_undef_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| VALUE rb_gvar_val_getter | ( | ID | id, |
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| void rb_gvar_val_marker | ( | VALUE * | var | ) |
| void rb_gvar_val_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| VALUE rb_gvar_var_getter | ( | ID | id, |
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| void rb_gvar_var_marker | ( | VALUE * | var | ) |
| void rb_gvar_var_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
Definition at line 66 of file hash.c.
References id_hash, LONG2FIX, rb_funcall(), rb_to_int(), RBIGNUM_DIGITS, T_BIGNUM, T_FIXNUM, and TYPE.
Definition at line 2778 of file object.c.
References NIL_P, RARRAY_LEN, rb_check_hash_type(), rb_eTypeError, rb_hash_new(), rb_obj_classname(), rb_raise(), RB_TYPE_P, and T_ARRAY.
Definition at line 560 of file hash.c.
References hash_default_value(), RHASH, st_lookup(), and val.
Definition at line 1138 of file hash.c.
References clear_i(), hash(), rb_hash_foreach(), rb_hash_modify_check(), RHASH, RHASH_ITER_LEV, and st_clear().
Definition at line 859 of file hash.c.
References Qnil, Qundef, rb_block_given_p(), rb_hash_delete_key(), rb_hash_modify_check(), rb_yield(), and val.
Definition at line 959 of file hash.c.
References delete_if_i(), hash(), rb_hash_foreach(), rb_hash_modify_check(), rb_hash_size(), RETURN_SIZED_ENUMERATOR, and RHASH.
Definition at line 240 of file hash.c.
References FL_EXIVAR, FL_SET, FL_TAINT, FL_TEST, FL_UNTRUSTED, HASH_PROC_DEFAULT, NEWOBJ_OF, rb_copy_generic_ivar(), rb_obj_class(), RBASIC, RHASH, RHASH_EMPTY_P, RHASH_IFNONE, st_copy(), and T_MASK.
| st_index_t rb_hash_end | ( | st_index_t | ) |
Definition at line 645 of file hash.c.
References rb_hash_fetch_m().
Definition at line 200 of file hash.c.
References hash_foreach_arg::arg, func, hash_foreach_arg::func, hash(), hash_foreach_arg::hash, hash_foreach_call(), hash_foreach_ensure(), rb_ensure(), RHASH, and RHASH_ITER_LEV.
Definition at line 36 of file hash.c.
References rb_obj_freeze().
Definition at line 582 of file hash.c.
References Qnil, and rb_hash_lookup2().
Definition at line 571 of file hash.c.
References RHASH, st_lookup(), and val.
| VALUE rb_hash_new | ( | void | ) |
Definition at line 234 of file hash.c.
References hash_alloc(), and rb_cHash.
| st_index_t rb_hash_proc | ( | st_index_t | hash, |
| VALUE | proc | ||
| ) |
Definition at line 804 of file proc.c.
References rb_proc_t::block, rb_proc_t::envval, rb_block_struct::ep, GetProcPtr, rb_block_struct::iseq, and rb_hash_uint.
| st_index_t rb_hash_start | ( | st_index_t | ) |
Definition at line 1416 of file random.c.
References hashseed, and st_hash_start.
Definition at line 266 of file hash.c.
References RHASH, and st_init_table().
| st_index_t rb_hash_uint | ( | st_index_t | , |
| st_index_t | |||
| ) |
| st_index_t rb_hash_uint32 | ( | st_index_t | , |
| uint32_t | |||
| ) |
| VALUE rb_hash_update_by | ( | VALUE | hash1, |
| VALUE | hash2, | ||
| rb_hash_update_func * | func | ||
| ) |
Definition at line 1944 of file hash.c.
References func, update_arg::func, update_arg::hash, rb_hash_foreach(), rb_hash_modify(), and to_hash().
Definition at line 2888 of file file.c.
References buf, getenv(), Inc, p, Qnil, rb_eArgError, rb_enc_associate(), rb_filesystem_encoding(), rb_raise(), rb_str_resize(), result, RSTRING_PTR, and strlen().
Definition at line 16068 of file ripper.c.
References rb_id2str(), and RSTRING_PTR.
Referenced by add_opt_method(), addrinfo_inspect(), assignable_gen(), cbsubst_get_subst_arg(), cbsubst_sym_to_subst(), cbsubst_table_setup(), check_dump_arg(), check_exec_redirect(), check_load_arg(), chunk_ii(), control_frame_dump(), econv_opts(), error_pos(), esignal_init(), extract_user_token(), fole_missing(), get_eval_string_core(), gettable_gen(), id2ref(), insn_data_to_s_detail(), insn_operand_intern(), inspect_enumerator(), inspect_i(), inspect_sockaddr(), iow_inspect(), iseq_compile_each(), match_aref(), match_backref_number(), mnew(), must_respond_to(), new_bv_gen(), num_sadded(), ossl_pkcs7_sym2typeid(), ossl_sslctx_set_ssl_version(), r_object0(), racc_yyparse(), rb_attr(), rb_define_class_id_under(), rb_dlcfunc_call(), rb_execarg_addopt(), rb_f_kill(), rb_f_local_variables(), rb_insecure_operation(), rb_method_call_status(), rb_method_entry_make(), rb_notimplement(), rb_search_method_entry(), rb_secure(), rb_str_format(), rb_str_setter(), rb_struct_aref_id(), rb_struct_aset_id(), rb_struct_getmember(), rb_struct_set(), rb_thread_current_status(), rb_undef(), reg_named_capture_assign_iter(), remove_method(), rsock_revlookup_flag(), ruby_debug_print_id(), set_method_visibility(), shadowing_lvar_gen(), sockopt_inspect(), symbol2event_flag(), trap_signm(), validate_label(), vm_call_method(), vm_getivar(), void_expr_gen(), vtable_add(), and warn_unused_var().
Definition at line 16007 of file ripper.c.
References global_symbols, i, ID_CONST, ID_LOCAL, symbols::id_str, is_attrset_id, is_local_id, OBJ_FREEZE, symbols::op_sym, op_tbl, op_tbl_count, rb_cString, rb_id2str(), rb_intern_str, rb_ispunct(), rb_str_cat(), rb_str_dup(), rb_usascii_str_new(), rb_usascii_str_new2, RBASIC, st_lookup(), tLAST_TOKEN, and token.
Referenced by add_id(), addrinfo_mdump(), fc_path(), id_to_name(), insn_operand_intern(), inspect_struct(), intern_str(), is_private_local_id(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), location_label(), location_to_str(), method_inspect(), oldbt_iter_cfunc(), r_unique(), rb_attr(), rb_define_class_id_under(), rb_define_module_id_under(), rb_enc_get_index(), rb_id2name(), rb_id2str(), rb_id_quote_unprintable(), rb_iseq_parameters(), rb_method_entry_make(), rb_sym_to_s(), rsock_ipaddr(), sym_capitalize(), sym_downcase(), sym_empty(), sym_encoding(), sym_inspect(), sym_length(), sym_swapcase(), sym_upcase(), trap_handler(), and w_symbol().
Definition at line 14326 of file ripper.c.
References id, and ID_ATTRSET.
Referenced by attrset_gen(), intern_str(), make_struct(), rb_attr(), rb_check_id(), rb_check_id_cstr(), and rb_struct_set().
| ID rb_id_encoding | ( | void | ) |
Definition at line 681 of file encoding.c.
References CONST_ID, and id_encoding.
Referenced by enc_set_index(), id2encidx(), rb_enc_get_index(), w_encoding(), and w_obj_each().
Definition at line 7841 of file string.c.
References rb_id2str(), and rb_str_quote_unprintable().
| VALUE rb_insns_name_array | ( | void | ) |
Definition at line 5481 of file compile.c.
References i, numberof, rb_ary_new(), rb_ary_push(), rb_obj_freeze(), and rb_str_new2.
Referenced by Init_VM().
Definition at line 402 of file object.c.
References id_inspect, rb_default_external_encoding(), rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_str_asciionly_p(), rb_funcall(), rb_obj_as_string(), and rb_raise().
| VALUE rb_int2big | ( | SIGNED_VALUE | ) |
| VALUE rb_int2big | ( | SIGNED_VALUE | ) |
Definition at line 309 of file bignum.c.
References neg, rb_uint2big(), and RBIGNUM_SET_SIGN.
Referenced by big_fdiv(), bigdivmod(), bigdivrem(), bigsub_int(), f_imul(), fix_cmp(), fix_divide(), fix_divmod(), fix_fdiv(), fix_ge(), fix_gt(), fix_le(), fix_lshift(), fix_lt(), fix_minus(), fix_mod(), fix_mul(), fix_pow(), int_pow(), power_cache_get_power0(), rb_big_cmp(), rb_big_coerce(), rb_big_divide(), rb_big_divmod(), rb_big_eq(), rb_big_modulo(), rb_big_mul(), rb_big_remainder(), rb_fix_lshift(), rb_fix_rshift(), rb_int2inum(), rb_int2num_inline(), rb_long2num_inline(), rb_quad_pack(), rb_str_format(), and w_object().
| VALUE rb_int2inum | ( | SIGNED_VALUE | ) |
| VALUE rb_int2inum | ( | SIGNED_VALUE | ) |
Definition at line 337 of file bignum.c.
References FIXABLE, LONG2FIX, and rb_int2big().
Referenced by gzfile_reader_rewind().
|
inlinestatic |
Definition at line 1171 of file ruby.h.
References FIXABLE, INT2FIX, and rb_int2big().
Definition at line 2469 of file object.c.
References rb_convert_to_integer().
Definition at line 1459 of file bignum.c.
References FIX2LONG, FIXNUM_MAX, FIXNUM_MIN, FIXNUM_P, INT2FIX, isinf(), isnan, Qnil, rb_big_cmp(), rb_dbl2big(), and RFLOAT_VALUE.
Referenced by big_op(), fix_cmp(), fix_ge(), fix_gt(), fix_le(), fix_lt(), flo_cmp(), flo_ge(), flo_gt(), flo_le(), flo_lt(), and rb_big_cmp().
Definition at line 1509 of file bignum.c.
References FIX2LONG, FIXNUM_P, isinf(), isnan, LONG_MAX, LONG_MIN, Qfalse, Qtrue, rb_big_eq(), rb_dbl2big(), and RFLOAT_VALUE.
Referenced by fix_equal(), flo_eq(), and rb_big_eq().
Definition at line 15991 of file ripper.c.
References rb_intern, rb_intern2(), and strlen().
Definition at line 15984 of file ripper.c.
References rb_intern3(), and rb_usascii_encoding().
Referenced by global_id(), Init_load(), rb_f_global_variables(), rb_intern(), and yyparse().
| ID rb_intern3 | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 15856 of file ripper.c.
References RString::as, RString::basic, RBasic::flags, global_symbols, RString::heap, intern_str(), RBasic::klass, RString::len, OBJ_FREEZE, rb_cString, rb_enc_associate(), rb_enc_str_new(), RSTRING_NOEMBED, st_lookup(), symbols::sym_id, and T_STRING.
Referenced by intern_str(), rb_intern2(), rb_mod_const_get(), and reg_named_capture_assign_iter().
Definition at line 15997 of file ripper.c.
References global_symbols, id, intern_str(), rb_str_dup(), st_lookup(), and symbols::sym_id.
| ID rb_interned_id_p | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
| void rb_interrupt | ( | void | ) |
Definition at line 545 of file eval.c.
References rb_eInterrupt, and rb_raise().
Referenced by rb_signal_exec().
Definition at line 42 of file compar.c.
References INT2FIX, invcmp_recursive(), NIL_P, Qnil, Qundef, rb_cmpint(), rb_exec_recursive(), and result.
Referenced by rb_str_cmp_m(), and time_cmp().
Definition at line 1437 of file io.c.
References rb_io_write().
Definition at line 4580 of file io.c.
References clear_codeconv(), rb_io_t::rb_io_enc_t::ecflags, rb_io_t::rb_io_enc_t::ecopts, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, FMODE_BINMODE, FMODE_TEXTMODE, finish_writeconv_arg::fptr, GetOpenFile, rb_io_t::mode, NULL, Qnil, rb_ascii8bit_encoding(), rb_econv_close(), rb_io_t::readconv, SET_BINARY_MODE_WITH_SEEK_CUR, and rb_io_t::writeconv.
Definition at line 4556 of file io.c.
References ECONV_NEWLINE_DECORATOR_MASK, rb_io_t::fd, FMODE_BINMODE, FMODE_TEXTMODE, finish_writeconv_arg::fptr, GetOpenFile, rb_io_t::mode, O_BINARY, rb_econv_binmode(), rb_io_t::readconv, SET_BINARY_MODE_WITH_SEEK_CUR, rb_io_t::writeconv, and rb_io_t::writeconv_pre_ecflags.
| ssize_t rb_io_bufread | ( | VALUE | io, |
| void * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 2038 of file io.c.
References binwrite_arg::fptr, GetOpenFile, io_bufread(), and rb_io_check_readable().
Definition at line 4187 of file io.c.
References FALSE, rb_io_t::fd, finish_writeconv_arg::fptr, GetWriteIO, rb_io_t::pid, Qnil, rb_io_fptr_cleanup(), rb_last_status_clear(), rb_syswait(), rb_thread_fd_close(), RFILE, and TRUE.
Definition at line 1706 of file io.c.
References rb_io_t::fd, binwrite_arg::fptr, GetOpenFile, io_fillbuf(), NEED_NEWLINE_DECORATOR_ON_READ, NEED_READCONV, Qfalse, Qtrue, rb_io_check_char_readable(), READ_CHAR_PENDING, READ_CHECK, and READ_DATA_PENDING.
Definition at line 1470 of file io.c.
References rb_io_t::fd, FMODE_READABLE, FMODE_WRITABLE, binwrite_arg::fptr, GetOpenFile, GetWriteIO, id_flush, io_fflush(), io_unread(), rb_io_t::mode, rb_funcall(), rb_sys_fail(), rb_thread_io_blocking_region(), RB_TYPE_P, rb_w32_get_osfhandle(), and T_FILE.
Definition at line 3667 of file io.c.
References c, rb_io_t::fd, FMODE_TTY, GetOpenFile, INT2FIX, io_fillbuf(), rb_io_buffer_t::len, rb_io_t::mode, rb_io_buffer_t::off, rb_io_buffer_t::ptr, Qnil, rb_io_check_byte_readable(), rb_io_flush(), rb_stdout, RB_TYPE_P, rb_io_t::rbuf, READ_CHECK, and T_FILE.
Definition at line 3076 of file io.c.
References rb_default_rs, and rb_io_getline_1().
Definition at line 6682 of file io.c.
References argc, i, NIL_P, Qnil, rb_io_write(), rb_lastline_get(), rb_output_fs, and rb_output_rs.
Definition at line 6623 of file io.c.
References Qnil, rb_f_sprintf(), and rb_io_write().
Definition at line 6847 of file io.c.
References argc, i, io_puts_ary(), Qnil, rb_default_rs, rb_exec_recursive(), rb_io_write(), rb_obj_as_string(), RB_TYPE_P, RSTRING_LEN, str_end_with_asciichar(), and T_STRING.
Definition at line 3728 of file io.c.
References FIX2INT, FIXNUM_P, GetOpenFile, io_ungetbyte(), NIL_P, Qnil, rb_io_check_byte_readable(), rb_str_new(), and SafeStringValue.
Definition at line 3763 of file io.c.
References rb_io_buffer_t::capa, rb_io_t::cbuf, FIX2UINT, FIXNUM_P, GetOpenFile, io_read_encoding(), io_ungetbyte(), rb_io_buffer_t::len, make_readconv(), MEMMOVE, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NIL_P, NUM2UINT, rb_io_buffer_t::off, rb_io_buffer_t::ptr, Qnil, rb_eIOError, rb_enc_uint_chr(), rb_io_check_char_readable(), rb_raise(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, SafeStringValue, SET_BINARY_MODE, and T_BIGNUM.
Definition at line 1415 of file io.c.
References id_write, and rb_funcall().
| int rb_is_absolute_path | ( | const char * | ) |
| int rb_is_attrset_id | ( | ID | ) |
Definition at line 16133 of file ripper.c.
References is_attrset_id.
| int rb_is_attrset_name | ( | VALUE | name | ) |
Definition at line 16261 of file ripper.c.
References ID_ATTRSET, and rb_str_symname_type().
Referenced by rb_check_id(), and rb_check_id_cstr().
| int rb_is_class_id | ( | ID | ) |
Definition at line 16115 of file ripper.c.
References is_class_id.
Referenced by cv_i(), rb_cv_get(), rb_cv_set(), rb_define_class_variable(), rb_mod_cvar_defined(), rb_mod_cvar_get(), rb_mod_cvar_set(), and rb_mod_remove_cvar().
| int rb_is_class_name | ( | VALUE | name | ) |
Definition at line 16243 of file ripper.c.
References ID_CLASS, and rb_str_symname_type().
Referenced by rb_mod_cvar_defined(), rb_mod_cvar_get(), and rb_mod_remove_cvar().
| int rb_is_const_id | ( | ID | ) |
Definition at line 16109 of file ripper.c.
References is_const_id.
Referenced by defined_expr(), fc_i(), inspect_struct(), iseq_compile_each(), make_struct(), ole_const_load(), rb_attr(), rb_autoload(), rb_define_const(), rb_mod_const_defined(), rb_mod_const_get(), rb_mod_const_set(), rb_mod_remove_const(), and sv_i().
| int rb_is_const_name | ( | VALUE | name | ) |
Definition at line 16237 of file ripper.c.
References ID_CONST, and rb_str_symname_type().
Referenced by rb_mod_const_defined(), and rb_mod_remove_const().
| int rb_is_global_id | ( | ID | ) |
Definition at line 16121 of file ripper.c.
References is_global_id.
| int rb_is_global_name | ( | VALUE | name | ) |
Definition at line 16249 of file ripper.c.
References ID_GLOBAL, and rb_str_symname_type().
| int rb_is_instance_id | ( | ID | ) |
Definition at line 16127 of file ripper.c.
References is_instance_id.
Referenced by inspect_i(), ivar_i(), rb_obj_ivar_defined(), rb_obj_ivar_get(), rb_obj_ivar_set(), and rb_obj_remove_instance_variable().
| int rb_is_instance_name | ( | VALUE | name | ) |
Definition at line 16255 of file ripper.c.
References ID_INSTANCE, and rb_str_symname_type().
Referenced by rb_obj_ivar_defined(), rb_obj_ivar_get(), and rb_obj_remove_instance_variable().
| int rb_is_junk_id | ( | ID | ) |
Definition at line 16145 of file ripper.c.
References is_junk_id.
| int rb_is_junk_name | ( | VALUE | name | ) |
Definition at line 16283 of file ripper.c.
References rb_str_symname_type().
| int rb_is_local_id | ( | ID | ) |
Definition at line 16139 of file ripper.c.
References is_local_id.
Referenced by collect_local_variables_in_iseq(), inspect_struct(), and rb_attr().
| int rb_is_local_name | ( | VALUE | name | ) |
Definition at line 16267 of file ripper.c.
References ID_LOCAL, and rb_str_symname_type().
| int rb_is_method_name | ( | VALUE | name | ) |
Definition at line 16273 of file ripper.c.
References FALSE, ID_ATTRSET, ID_JUNK, ID_LOCAL, rb_str_symname_type(), and TRUE.
| int rb_isalnum | ( | int | c | ) |
Definition at line 1882 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_ALNUM.
| int rb_isalpha | ( | int | c | ) |
Definition at line 1883 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_ALPHA.
| int rb_isblank | ( | int | c | ) |
Definition at line 1884 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_BLANK.
| int rb_iscntrl | ( | int | c | ) |
Definition at line 1885 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_CNTRL.
| int rb_isdigit | ( | int | c | ) |
Definition at line 1886 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_DIGIT.
Referenced by f_format().
Definition at line 1884 of file iseq.c.
References rb_iseq_struct::cref_stack, GetISeqPtr, iseq_alloc(), rb_iseq_struct::klass, rb_iseq_struct::local_iseq, NEW_CREF, rb_iseq_struct::orig, rb_cISeq, and rb_iseq_struct::self.
| int rb_isgraph | ( | int | c | ) |
Definition at line 1887 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_GRAPH.
| int rb_islower | ( | int | c | ) |
Definition at line 1888 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_LOWER.
| int rb_isprint | ( | int | c | ) |
Definition at line 1889 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_PRINT.
Referenced by curses_getch(), and window_getch().
| int rb_ispunct | ( | int | c | ) |
Definition at line 1890 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_PUNCT.
Referenced by rb_id2str().
| int rb_isspace | ( | int | c | ) |
Definition at line 1891 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_SPACE.
Referenced by rb_str_lstrip_bang(), rb_str_rstrip_bang(), and rb_str_split_m().
| int rb_isupper | ( | int | c | ) |
Definition at line 1892 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_UPPER.
| int rb_isxdigit | ( | int | c | ) |
Definition at line 1893 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_XDIGIT.
Definition at line 1032 of file vm_eval.c.
References rb_method_entry_struct::called_id, rb_thread_struct::cfp, rb_control_frame_struct::ep, err, rb_thread_struct::errinfo, EXEC_EVENT_HOOK, GET_THREAD(), GET_THROWOBJ_CATCH_POINT, GET_THROWOBJ_VAL, rb_block_struct::iseq, rb_method_entry_struct::klass, rb_control_frame_struct::me, NEW_IFUNC, rb_thread_struct::passed_block, rb_block_struct::proc, Qnil, rb_frame_this_func(), RUBY_DTRACE_CMETHOD_RETURN_HOOK, RUBY_EVENT_C_RETURN, RUBY_VM_GET_BLOCK_PTR_IN_CFP, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_control_frame_struct::self, rb_thread_struct::state, TAG_BREAK, TAG_RETRY, TH_EXEC_TAG, TH_JUMP_TAG, TH_POP_TAG, TH_PUSH_TAG, UNLIKELY, VM_CF_BLOCK_PTR(), VM_FRAME_MAGIC_CFUNC, and VM_FRAME_TYPE.
Definition at line 2578 of file variable.c.
Definition at line 2578 of file variable.c.
References rb_intern, and rb_ivar_get().
Definition at line 2586 of file variable.c.
References rb_intern, and rb_ivar_set().
| st_index_t rb_ivar_count | ( | VALUE | ) |
Definition at line 1294 of file variable.c.
References BUILTIN_TYPE, count, FL_EXIVAR, FL_TEST, i, st_table::num_entries, Qundef, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, SPECIAL_CONST_P, st_lookup(), T_CLASS, T_MODULE, and T_OBJECT.
Definition at line 1199 of file variable.c.
References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, generic_ivar_defined(), Qfalse, Qtrue, Qundef, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, SPECIAL_CONST_P, st_lookup(), T_CLASS, T_MODULE, T_OBJECT, and val.
Definition at line 1266 of file variable.c.
References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, func, obj_ivar_each(), rb_special_const_p(), RCLASS_IV_TBL, SPECIAL_CONST_P, st_foreach_safe(), st_lookup(), T_CLASS, T_MODULE, and T_OBJECT.
Definition at line 1111 of file variable.c.
References ivar_get(), and TRUE.
Definition at line 1123 of file variable.c.
References ALLOC_N, st_table::as, BUILTIN_TYPE, generic_ivar_set(), i, MEMCPY, st_table::num_entries, OBJ_UNTRUSTED, Qundef, rb_check_frozen, rb_eSecurityError, rb_obj_class(), rb_raise(), rb_safe_level, RBASIC, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, REALLOC_N, ROBJECT, ROBJECT_EMBED, ROBJECT_EMBED_LEN_MAX, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, SPECIAL_CONST_P, st_add_direct(), st_init_numtable(), st_insert(), st_lookup(), T_CLASS, T_MODULE, and T_OBJECT.
| void rb_last_status_clear | ( | void | ) |
Definition at line 285 of file process.c.
References GET_THREAD(), rb_thread_struct::last_status, and Qnil.
| VALUE rb_last_status_get | ( | void | ) |
Definition at line 270 of file process.c.
References GET_THREAD(), and rb_thread_struct::last_status.
| void rb_last_status_set | ( | int | status, |
| rb_pid_t | pid | ||
| ) |
Definition at line 276 of file process.c.
References GET_THREAD(), INT2FIX, rb_thread_struct::last_status, PIDT2NUM, rb_cProcessStatus, rb_iv_set(), and rb_obj_alloc().
| VALUE rb_lastline_get | ( | void | ) |
Definition at line 774 of file vm.c.
References vm_svar_get().
| void rb_lastline_set | ( | VALUE | ) |
Definition at line 780 of file vm.c.
References vm_svar_set().
Definition at line 1711 of file rational.c.
References f_lcm(), and nurat_int_value().
| void rb_load | ( | VALUE | , |
| int | |||
| ) |
Definition at line 626 of file load.c.
References FilePathValue, load_failed(), rb_find_file(), and rb_load_internal().
| void* rb_load_file | ( | const char * | ) |
Definition at line 824 of file pepper_main.c.
References PepperInstance::as_int, PepperInstance::as_value, PepperInstance::async_call_args, PepperInstance::async_call_result, cmdline_options_init(), PepperInstance::cond, core_interface, f, FIXNUM_P, GET_PEPPER_INSTANCE, PepperInstance::instance, load_file(), load_file_internal(), load_file_read_contents(), PepperInstance::mutex, pruby_file_fetch_check_response(), rb_compile_cstr(), rb_parser_new(), rb_str_new_cstr(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, and T_STRING.
| void rb_load_protect | ( | VALUE | , |
| int | , | ||
| int * | |||
| ) |
| int rb_local_defined | ( | ID | ) |
Definition at line 5857 of file compile.c.
References rb_thread_struct::base_block, GET_THREAD(), i, rb_block_struct::iseq, rb_iseq_struct::local_iseq, rb_iseq_struct::local_table, and rb_iseq_struct::local_table_size.
Referenced by local_id_gen().
Definition at line 1477 of file encoding.c.
References nl_langinfo_codeset(), Qnil, rb_usascii_str_new2, and snprintf.
Referenced by encoding_table_get_name_core(), Init_Encoding(), and rb_locale_encindex().
| int rb_locale_encindex | ( | void | ) |
Definition at line 1196 of file encoding.c.
References enc_alias_internal(), NIL_P, rb_ascii8bit_encindex(), rb_cEncoding, rb_enc_find_index(), rb_enc_registered(), rb_locale_charmap(), rb_usascii_encindex(), and StringValueCStr.
Referenced by rb_locale_encoding().
| rb_encoding* rb_locale_encoding | ( | void | ) |
Definition at line 1212 of file encoding.c.
References rb_enc_from_index(), and rb_locale_encindex().
Referenced by env_str_new(), load_file_internal(), locale_path(), process_options(), rb_default_external_encoding(), rb_loaderror(), rb_loaderror_with_path(), rb_locale_str_new(), rb_locale_str_new_cstr(), rb_str_export_locale(), rb_strftime_with_timespec(), readline_attempted_completion_function(), and syserr_initialize().
Definition at line 596 of file string.c.
References rb_external_str_new_with_enc(), and rb_locale_encoding().
Definition at line 602 of file string.c.
References rb_external_str_new_with_enc(), rb_locale_encoding(), and strlen().
|
inlinestatic |
Definition at line 1192 of file ruby.h.
References FIXABLE, LONG2FIX, and rb_int2big().
| VALUE rb_make_backtrace | ( | void | ) |
Definition at line 772 of file vm_backtrace.c.
References GET_THREAD(), and vm_backtrace_str_ary().
| VALUE rb_make_backtrace | ( | void | ) |
Definition at line 772 of file vm_backtrace.c.
Definition at line 642 of file eval.c.
References make_exception(), and TRUE.
Referenced by parser_set_encode(), rb_f_raise(), and rb_threadptr_raise().
| void rb_mark_end_proc | ( | void | ) |
Definition at line 80 of file eval_jump.c.
References end_proc_data::data, end_procs, ephemeral_end_procs, link(), end_proc_data::next, and rb_gc_mark().
Referenced by gc_marks().
| void rb_mark_generic_ivar | ( | VALUE | ) |
Definition at line 985 of file variable.c.
References rb_mark_tbl(), and st_lookup().
| void rb_mark_generic_ivar_tbl | ( | void | ) |
Definition at line 1015 of file variable.c.
References givar_i(), and st_foreach_safe().
| void rb_mark_hash | ( | struct st_table * | ) |
Definition at line 2411 of file gc.c.
References mark_hash().
| void rb_mark_set | ( | struct st_table * | ) |
Definition at line 2387 of file gc.c.
References mark_set().
| void rb_mark_tbl | ( | struct st_table * | ) |
Definition at line 2541 of file gc.c.
References mark_tbl().
| void rb_marshal_define_compat | ( | VALUE | newclass, |
| VALUE | oldclass, | ||
| VALUE(*)(VALUE) | dumper, | ||
| VALUE(*)(VALUE, VALUE) | loader | ||
| ) |
Definition at line 113 of file marshal.c.
References ALLOC, marshal_compat_t::dumper, marshal_compat_t::loader, marshal_compat_t::newclass, marshal_compat_t::oldclass, Qnil, rb_eTypeError, rb_get_alloc_func(), rb_raise(), and st_insert().
Definition at line 2123 of file marshal.c.
References marshal_load().
| void rb_maygvl_fd_fix_cloexec | ( | int | fd | ) |
| void rb_mem_clear | ( | register VALUE * | , |
| register | long | ||
| ) |
Definition at line 37 of file array.c.
References Qnil.
Referenced by ary_make_shared(), rb_ary_fill(), rb_ary_resize(), rb_ary_shift_m(), rb_ary_splice(), rb_ary_store(), rb_struct_initialize_m(), and struct_alloc().
| st_index_t rb_memhash | ( | const void * | ptr, |
| long | len | ||
| ) |
Definition at line 1422 of file random.c.
References sip_hash24, sipseed, and sip_uint64_t::u32.
| long rb_memsearch | ( | const void * | , |
| long | , | ||
| const void * | , | ||
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 227 of file re.c.
References memcmp(), rb_memsearch_qs(), rb_memsearch_qs_utf8(), rb_memsearch_ss(), rb_utf8_encoding(), and SIZEOF_VALUE.
Definition at line 1491 of file vm_method.c.
References rb_method_entry_struct::flag, cache_entry::me, NOEX_BASIC, and rb_method_entry().
Definition at line 769 of file vm_method.c.
References rb_method_entry_struct::def, rb_method_entry_struct::flag, cache_entry::me, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_RESPONDS, rb_method_entry_without_refinements(), rb_method_definition_struct::type, and VM_METHOD_TYPE_NOTIMPLEMENTED.
Definition at line 1520 of file proc.c.
References Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block().
Definition at line 1527 of file proc.c.
References rb_proc_t::block, METHOD::defined_class, EXEC_TAG, GET_THREAD(), GetProcPtr, METHOD::id, JUMP_TAG, METHOD::me, method_data_type, NIL_P, OBJ_TAINTED, rb_thread_struct::passed_block, POP_TAG, PUSH_TAG, Qnil, Qundef, rb_eTypeError, rb_raise(), rb_safe_level, rb_set_safe_level_force(), rb_vm_call(), METHOD::recv, result, and TypedData_Get_Struct.
Definition at line 2503 of file variable.c.
References cvar_list(), mod_cvar_at(), mod_cvar_of(), Qtrue, rb_scan_args(), and RTEST.
| void* rb_mod_const_at | ( | VALUE | , |
| void * | |||
| ) |
Definition at line 1977 of file variable.c.
References RCLASS_CONST_TBL, st_foreach_safe(), st_init_numtable(), and sv_i().
Definition at line 1513 of file variable.c.
References rb_frame_pop(), rb_to_id(), uninitialized_constant(), and UNREACHABLE.
| void* rb_mod_const_of | ( | VALUE | , |
| void * | |||
| ) |
Definition at line 1990 of file variable.c.
References mod, rb_cObject, rb_mod_const_at(), and RCLASS_SUPER.
Definition at line 2041 of file variable.c.
References Qtrue, rb_const_list(), rb_mod_const_at(), rb_mod_const_of(), rb_scan_args(), and RTEST.
Definition at line 1823 of file proc.c.
References METHOD::me, original_method_entry(), and rb_method_entry_arity().
Definition at line 1666 of file vm_eval.c.
References specific_eval().
Definition at line 1692 of file vm_eval.c.
References rb_ary_new4(), and yield_under().
Definition at line 205 of file variable.c.
References classname(), NIL_P, fc_result::path, and rb_str_dup().
Definition at line 1911 of file variable.c.
References PRIsVALUE, QUOTE, QUOTE_ID, rb_check_id(), rb_class_name(), rb_const_remove(), rb_is_const_id(), rb_is_const_name(), rb_name_error(), and rb_name_error_str().
Definition at line 2544 of file variable.c.
References id, OBJ_UNTRUSTED, PRIsVALUE, QUOTE, QUOTE_ID, rb_check_frozen, rb_check_id(), rb_class_name(), rb_cvar_defined(), rb_eSecurityError, rb_is_class_id(), rb_is_class_name(), rb_name_error(), rb_name_error_str(), rb_raise(), rb_safe_level, RCLASS_IV_TBL, st_delete(), UNREACHABLE, and val.
| void rb_must_asciicompat | ( | VALUE | ) |
Definition at line 1463 of file string.c.
References rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, and rb_raise().
| void rb_mutex_allow_trap | ( | VALUE | self, |
| int | val | ||
| ) |
Definition at line 4540 of file thread.c.
References rb_mutex_struct::allow_trap, and GetMutexPtr.
Definition at line 4291 of file thread.c.
References rb_mutex_struct::allow_trap, FALSE, GET_THREAD(), GetMutexPtr, GVL_UNLOCK_BEGIN, GVL_UNLOCK_END, rb_thread_struct::interrupt_mask, rb_mutex_struct::lock, lock_func(), lock_interrupt(), rb_thread_struct::locking_mutex, mutex_locked(), NULL, Qfalse, rb_check_deadlock(), rb_eThreadError, rb_mutex_trylock(), rb_raise(), reset_unblock_function(), RUBY_VM_CHECK_INTS_BLOCKING, set_unblock_function(), rb_vm_struct::sleeper, rb_thread_struct::status, rb_mutex_struct::th, THREAD_STOPPED_FOREVER, TRAP_INTERRUPT_MASK, rb_thread_struct::vm, and vm_living_thread_num().
Definition at line 4181 of file thread.c.
References GetMutexPtr, Qfalse, Qtrue, and rb_mutex_struct::th.
| VALUE rb_mutex_new | ( | void | ) |
Definition at line 4169 of file thread.c.
References mutex_alloc(), and rb_cMutex.
Definition at line 4367 of file thread.c.
References GET_THREAD(), GetMutexPtr, Qfalse, Qtrue, and rb_mutex_struct::th.
Definition at line 4468 of file thread.c.
References INT2FIX, NIL_P, Qnil, rb_ensure(), rb_mutex_lock(), rb_mutex_sleep_forever(), rb_mutex_unlock(), rb_mutex_wait_for(), and rb_time_interval().
Definition at line 4517 of file thread.c.
References func, rb_ensure(), rb_mutex_lock(), and rb_mutex_unlock().
Definition at line 4208 of file thread.c.
References GET_THREAD(), GetMutexPtr, rb_mutex_struct::lock, mutex_locked(), Qfalse, Qtrue, and rb_mutex_struct::th.
Definition at line 4422 of file thread.c.
References rb_mutex_struct::allow_trap, err, GET_THREAD(), GetMutexPtr, rb_eThreadError, rb_mutex_unlock_th(), rb_raise(), and TRAP_INTERRUPT_MASK.
Definition at line 372 of file variable.c.
References classid, ID2SYM, and rb_ivar_set().
| void rb_need_block | ( | void | ) |
Definition at line 693 of file eval.c.
References Qnil, rb_block_given_p(), and rb_vm_localjump_error().
Referenced by generator_initialize(), and yielder_initialize().
Definition at line 694 of file gc.c.
References RNode::flags, nd_set_type, rb_newobj(), T_NODE, RNode::u1, RNode::u2, RNode::u3, and RNode::value.
|
inlinestatic |
Definition at line 1212 of file ruby.h.
References NUM2INT, RSTRING_LEN, RSTRING_PTR, T_STRING, and TYPE.
| double rb_num2dbl | ( | VALUE | ) |
Definition at line 2697 of file object.c.
References rb_eTypeError, rb_Float(), rb_raise(), RFLOAT_VALUE, T_FLOAT, T_NIL, T_STRING, and TYPE.
Definition at line 2175 of file numeric.c.
References FIXABLE, FIXNUM_P, LONG2FIX, PRIdVALUE, rb_eRangeError, rb_num2long(), rb_raise(), SIGNED_VALUE, and v.
| SIGNED_VALUE rb_num2long | ( | VALUE | ) |
Definition at line 1945 of file numeric.c.
References buf, FIX2LONG, FIXNUM_P, LONG_MAX_PLUS_ONE, LONG_MIN_MINUS_ONE, NIL_P, rb_big2long(), rb_eRangeError, rb_eTypeError, rb_raise(), rb_to_int(), RFLOAT_VALUE, SIGNED_VALUE, snprintf, strchr(), T_BIGNUM, T_FLOAT, and TYPE.
|
inlinestatic |
Definition at line 585 of file ruby.h.
References FIX2LONG, FIXNUM_P, and rb_num2long().
| short rb_num2short | ( | VALUE | ) |
Definition at line 2134 of file numeric.c.
References check_short(), and rb_num2long().
|
inlinestatic |
Definition at line 634 of file ruby.h.
References FIX2SHORT, FIXNUM_P, and rb_num2short().
Definition at line 1979 of file numeric.c.
References buf, FIX2LONG, FIXNUM_P, LONG_MIN_MINUS_ONE, NIL_P, rb_big2ulong(), rb_eRangeError, rb_eTypeError, rb_raise(), rb_to_int(), RFLOAT_VALUE, snprintf, strchr(), T_BIGNUM, T_FLOAT, TYPE, and ULONG_MAX_PLUS_ONE.
|
inlinestatic |
Definition at line 594 of file ruby.h.
References FIX2LONG, FIXNUM_P, and rb_num2ulong().
| unsigned short rb_num2ushort | ( | VALUE | ) |
Definition at line 2152 of file numeric.c.
References check_ushort(), negative_int_p(), and rb_num2ulong().
Definition at line 269 of file numeric.c.
References do_coerce(), rb_funcall(), and TRUE.
Definition at line 3206 of file numeric.c.
References bit_coerce(), rb_funcall(), and TRUE.
Definition at line 276 of file numeric.c.
References do_coerce(), FALSE, Qnil, and rb_funcall().
Definition at line 284 of file numeric.c.
References c, do_coerce(), FALSE, NIL_P, Qnil, rb_cmperr(), and rb_funcall().
| int rb_num_negative_p | ( | VALUE | ) |
Definition at line 189 of file numeric.c.
References negative_int_p().
| int rb_num_to_uint | ( | VALUE | val, |
| unsigned int * | ret | ||
| ) |
Definition at line 122 of file numeric.c.
References DIGSPERLONG, FIX2LONG, FIXNUM_P, NUMERR_NEGATIVE, NUMERR_TOOLARGE, NUMERR_TYPE, rb_big2ulong(), RBIGNUM_LEN, RBIGNUM_NEGATIVE_P, T_BIGNUM, TYPE, and v.
Definition at line 1702 of file object.c.
References FL_SINGLETON, FL_TEST, PRIsVALUE, rb_cBasicObject, rb_class2name(), rb_class_real(), rb_eTypeError, rb_get_alloc_func(), rb_obj_class(), rb_raise(), rb_sourcefile, rb_sourceline(), RCLASS_SUPER, RUBY_DTRACE_OBJECT_CREATE, and RUBY_DTRACE_OBJECT_CREATE_ENABLED.
Definition at line 895 of file string.c.
References OBJ_TAINT, OBJ_TAINTED, rb_any_to_s(), rb_funcall(), RB_TYPE_P, and T_STRING.
Definition at line 1227 of file eval.c.
References PASS_PASSED_BLOCK, and rb_funcall2().
Referenced by rb_class_new_instance(), rb_digest_class_s_digest(), rb_proc_s_new(), and thread_s_new().
Definition at line 194 of file object.c.
References CLASS_OF, and rb_class_real().
Definition at line 391 of file variable.c.
References CLASS_OF, and rb_class2name().
Definition at line 296 of file object.c.
References FL_FINALIZE, FL_FREEZE, FL_SINGLETON, FL_TAINT, FL_TEST, FL_UNTRUSTED, id_init_clone, init_copy(), rb_eTypeError, rb_funcall(), rb_obj_alloc(), rb_obj_class(), rb_obj_classname(), rb_raise(), rb_singleton_class_attached(), rb_singleton_class_clone_and_attach(), rb_special_const_p(), and RBASIC.
Definition at line 338 of file object.c.
References id_init_dup, init_copy(), rb_eTypeError, rb_funcall(), rb_obj_alloc(), rb_obj_class(), rb_obj_classname(), rb_raise(), and rb_special_const_p().
Definition at line 868 of file encoding.c.
References rb_enc_from_encoding_index(), rb_enc_get_index(), rb_eTypeError, and rb_raise().
Referenced by Init_Regexp(), Init_String(), lib_toUTF8_core(), str_transcode0(), and sym_encoding().
Definition at line 971 of file object.c.
References OBJ_FREEZE, OBJ_FROZEN, OBJ_UNTRUSTED, Qtrue, rb_eSecurityError, rb_raise(), rb_safe_level, SPECIAL_CONST_P, st_init_numtable(), and st_insert().
Definition at line 1000 of file object.c.
References OBJ_FROZEN, Qfalse, Qtrue, SPECIAL_CONST_P, and st_lookup().
Definition at line 1688 of file gc.c.
References FIXNUM_FLAG, FLONUM_P, LONG2NUM, nonspecial_obj_id, SIGNED_VALUE, SPECIAL_CONST_P, SYM2ID, and SYMBOL_P.
Definition at line 942 of file object.c.
References OBJ_INFECT.
Definition at line 354 of file object.c.
References rb_check_frozen, rb_check_trusted, rb_eTypeError, rb_obj_class(), rb_raise(), and TYPE.
Definition at line 1595 of file vm_eval.c.
References rb_singleton_class(), rb_special_singleton_class(), SPECIAL_CONST_P, and specific_eval().
Definition at line 1627 of file vm_eval.c.
References rb_ary_new4(), rb_singleton_class(), rb_special_singleton_class(), SPECIAL_CONST_P, and yield_under().
Definition at line 1363 of file variable.c.
References ivar_i(), rb_ary_new(), and rb_ivar_foreach().
Definition at line 333 of file cont.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by rb_objspace_call_finalizer().
Definition at line 545 of file object.c.
References class_or_module_required(), Qfalse, Qtrue, and rb_obj_class().
Definition at line 582 of file object.c.
References CLASS_OF, class_or_module_required(), Qfalse, Qtrue, RCLASS_M_TBL, RCLASS_ORIGIN, and RCLASS_SUPER.
Definition at line 925 of file proc.c.
References method_data_type, Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Definition at line 4134 of file thread.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Definition at line 91 of file proc.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Definition at line 1928 of file vm.c.
References Qfalse, Qtrue, rb_typeddata_is_kind_of(), and thread_data_type.
Definition at line 1232 of file proc.c.
References CLASS_OF, FALSE, mnew(), rb_check_id(), rb_cMethod, and rb_method_name_error().
Definition at line 1831 of file proc.c.
References CLASS_OF, and rb_mod_method_arity().
Definition at line 1395 of file variable.c.
References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, generic_ivar_remove(), id, OBJ_UNTRUSTED, PRIsVALUE, Qnil, Qundef, QUOTE, QUOTE_ID, rb_check_frozen, rb_check_id(), rb_eSecurityError, rb_is_instance_id(), rb_is_instance_name(), rb_name_error(), rb_name_error_str(), rb_raise(), rb_safe_level, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, SPECIAL_CONST_P, st_delete(), st_lookup(), T_CLASS, T_MODULE, T_OBJECT, UNREACHABLE, v, and val.
Definition at line 1518 of file vm_method.c.
References args, basic_obj_respond_to(), CLASS_OF, FL_SINGLETON, FL_TEST, ID2SYM, idRespond_to, NIL_P, NUM2INT, PRIsVALUE, Qtrue, QUOTE_ID, RARRAY_PTR, rb_compile_warn(), rb_funcall2(), rb_method_basic_definition_p(), rb_mod_method_location(), rb_obj_method_arity(), rb_warn(), RSTRING_PTR, RTEST, and ruby_verbose.
Definition at line 860 of file object.c.
References OBJ_TAINT, OBJ_TAINTED, rb_check_frozen, and rb_secure().
Definition at line 843 of file object.c.
References OBJ_TAINTED, Qfalse, and Qtrue.
Definition at line 931 of file object.c.
References FL_UNSET, FL_UNTRUSTED, OBJ_UNTRUSTED, rb_check_frozen, and rb_secure().
Definition at line 879 of file object.c.
References FL_TAINT, FL_UNSET, OBJ_TAINTED, rb_check_frozen, and rb_secure().
Definition at line 912 of file object.c.
References OBJ_UNTRUST, OBJ_UNTRUSTED, rb_check_frozen, and rb_secure().
Definition at line 897 of file object.c.
References OBJ_UNTRUSTED, Qfalse, and Qtrue.
Definition at line 749 of file gc.c.
References RTYPEDDATA_P, and RTYPEDDATA_TYPE.
| void rb_p | ( | VALUE | ) |
Definition at line 6896 of file io.c.
References CLASS_OF, id_write, io_write(), rb_default_rs, rb_inspect(), rb_io_write(), rb_method_basic_definition_p(), rb_obj_as_string(), rb_stdout, RB_TYPE_P, and T_FILE.
| int rb_parse_in_eval | ( | void | ) |
Definition at line 5876 of file compile.c.
References GET_THREAD(), and rb_thread_struct::parse_in_eval.
Referenced by parser_compile_string(), and rb_parser_compile_file().
| int rb_parse_in_main | ( | void | ) |
Definition at line 5882 of file compile.c.
References GET_THREAD(), and rb_thread_struct::parse_in_eval.
Referenced by yyparse().
Definition at line 15485 of file ripper.c.
References block_append, nd_type, NEW_ARRAY, NEW_FCALL, NEW_GVAR, NODE_PRELUDE, rb_intern, and TypedData_Get_Struct.
Referenced by process_options().
| void* rb_parser_calloc | ( | struct parser_params * | , |
| size_t | , | ||
| size_t | |||
| ) |
Definition at line 11111 of file ripper.c.
References parser_compile_string(), and rb_str_new().
Definition at line 11132 of file ripper.c.
References compile_for_eval, lex_gets, lex_input, lex_io_gets(), lex_p, lex_pbeg, lex_pend, RB_GC_GUARD, rb_parse_in_eval(), TypedData_Get_Struct, and yycompile().
Referenced by iseq_s_compile_file(), load_file_internal(), and rb_compile_file().
Definition at line 11097 of file ripper.c.
References must_be_ascii_compatible(), and parser_compile_string().
Referenced by load_file_internal(), parse_string(), and process_options().
Definition at line 889 of file node.c.
References buf, dump_node(), and rb_str_new_cstr().
Definition at line 16473 of file ripper.c.
References current_enc, rb_enc_from_encoding(), and TypedData_Get_Struct.
Referenced by load_file_internal().
Definition at line 16458 of file ripper.c.
References Qfalse, Qtrue, ruby__end__seen, and TypedData_Get_Struct.
Referenced by load_file_internal().
| void rb_parser_free | ( | struct parser_params * | , |
| void * | |||
| ) |
Definition at line 16559 of file ripper.c.
References parser_params::heap, RNode::node, NULL, rb_gc_force_recycle(), RNode::u2, and xfree.
Definition at line 16488 of file ripper.c.
References Qfalse, Qtrue, and TypedData_Get_Struct.
| void* rb_parser_malloc | ( | struct parser_params * | , |
| size_t | |||
| ) |
| VALUE rb_parser_new | ( | void | ) |
Definition at line 16444 of file ripper.c.
References parser_new(), and TypedData_Wrap_Struct.
Referenced by iseq_s_compile_file(), parse_string(), process_options(), rb_compile_cstr(), rb_compile_file(), rb_compile_string(), and rb_load_file().
| void* rb_parser_realloc | ( | struct parser_params * | , |
| void * | , | ||
| size_t | |||
| ) |
Definition at line 16539 of file ripper.c.
References ADD2HEAP, RNode::cnt, cnt, parser_params::heap, HEAPCNT, NEWHEAP, RNode::node, NULL, RNode::u1, RNode::u2, RNode::u3, and xrealloc.
Definition at line 16503 of file ripper.c.
References RTEST, and TypedData_Get_Struct.
Referenced by process_options().
Definition at line 15517 of file ripper.c.
References block_append, nd_type, NEW_CALL, NEW_GASGN, NEW_GVAR, NEW_OPT_N, NODE_PRELUDE, rb_intern, and TypedData_Get_Struct.
Referenced by process_options().
Definition at line 366 of file variable.c.
References rb_path_to_class(), and rb_str_new_cstr().
| int rb_path_check | ( | const char * | ) |
Definition at line 5229 of file file.c.
References p, path_check_0(), PATH_SEP_CHAR, rb_str_new(), strchr(), strlen(), and TRUE.
Definition at line 326 of file variable.c.
References c, id, p, fc_result::path, PRIsVALUE, QUOTE, rb_check_id_cstr(), rb_cObject, rb_const_defined_at(), rb_const_get_at(), rb_eArgError, rb_enc_asciicompat, rb_enc_get(), rb_eTypeError, RB_GC_GUARD, rb_raise(), RB_TYPE_P, RSTRING_PTR, T_CLASS, and T_MODULE.
| int rb_pipe | ( | int * | pipes | ) |
Definition at line 5514 of file io.c.
References errno, rb_cloexec_pipe(), rb_gc(), and rb_update_max_fd().
| int rb_proc_arity | ( | VALUE | ) |
Definition at line 702 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, max(), rb_proc_min_max_arity(), and UNLIMITED_ARGUMENTS.
Definition at line 592 of file proc.c.
References check_argc, GET_THREAD(), GetProcPtr, RARRAY_LEN, RARRAY_PTR, RB_GC_GUARD, and rb_vm_invoke_proc().
Definition at line 605 of file proc.c.
References rb_proc_t::block, GET_THREAD(), GetProcPtr, NIL_P, RB_GC_GUARD, and rb_vm_invoke_proc().
| int rb_proc_exec | ( | const char * | ) |
Definition at line 1308 of file process.c.
References after_exec(), before_exec(), preserving_errno, proc_exec_sh(), and Qfalse.
Definition at line 231 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, Qfalse, and Qtrue.
Definition at line 758 of file proc.c.
References get_proc_iseq, and iseq_location().
Definition at line 2018 of file proc.c.
References func, mproc(), and rb_iterate().
Definition at line 771 of file eval.c.
References rb_thread_struct::cfp, GET_THREAD(), MEMCPY, rb_vm_protect_tag::prev, rb_thread_struct::protect_tag, Qnil, result, SAVE_ROOT_JMPBUF, TH_EXEC_TAG, TH_POP_TAG, and TH_PUSH_TAG.
Referenced by BigDecimal_save_exception_mode(), BigDecimal_save_limit(), BigDecimal_save_rounding_mode(), decode_enum(), decode_int(), decode_time(), EVENTSINK_Invoke(), exc_equal(), fdbm_delete_if(), fgdbm_delete_if(), fsdbm_delete_if(), goruby_run_node(), gzfile_wrap(), init_libraries(), io_s_write(), ip_eval_real(), ip_invoke_core(), ip_ruby_cmd_receiver_get(), lib_eventloop_core(), lib_eventloop_main(), lib_thread_callback(), load_encoding(), name_err_mesg_to_str(), ossl_buf2str(), ossl_client_cert_cb(), ossl_pem_passwd_cb(), ossl_pkcs12_initialize(), ossl_protect_membio2str(), ossl_protect_obj2bio(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_tmp_dh_callback(), ossl_verify_cb(), parse(), pruby_obj_to_var(), rb_autoload_load(), rb_eval_string_protect(), rb_glob_caller(), rb_hash_fetch_m(), rb_io_s_pipe(), rb_io_s_read(), readline_readline(), ruby_eval_string_from_file_protect(), run_finalizer(), tcl_protect_core(), ttymode(), zstream_expand_buffer(), and zstream_expand_buffer_protect().
| void rb_provide | ( | const char * | ) |
Definition at line 554 of file load.c.
References rb_provide_feature(), and rb_usascii_str_new2.
| int rb_provided | ( | const char * | ) |
Definition at line 505 of file load.c.
References rb_feature_provided().
Definition at line 996 of file random.c.
References CHAR_BIT, genrand_int32(), i, id_bytes, RBignum::len, LONG2NUM, rb_random_t::mt, rb_funcall2(), rb_str_new(), RSTRING_PTR, SIZEOF_INT32, and try_get_rnd().
| unsigned int rb_random_int32 | ( | VALUE | rnd | ) |
Definition at line 914 of file random.c.
References genrand_int32(), id_rand, INT2FIX, rb_random_t::mt, NUM2ULONG, rb_big_plus(), rb_funcall2(), try_get_rnd(), and ULONG2NUM.
| double rb_random_real | ( | VALUE | rnd | ) |
Definition at line 931 of file random.c.
References genrand_real(), id_rand, rb_random_t::mt, NUM2DBL, rb_eRangeError, rb_funcall2(), rb_raise(), try_get_rnd(), and v.
| unsigned long rb_random_ulong_limited | ( | VALUE | rnd, |
| unsigned long | limit | ||
| ) |
Definition at line 962 of file random.c.
References id_rand, limited_rand(), rb_random_t::mt, NUM2ULONG, rb_eRangeError, rb_funcall2(), rb_num_negative_p(), rb_raise(), try_get_rnd(), ulong_to_num_plus_1(), and v.
Definition at line 987 of file range.c.
References NUM2LONG, Qfalse, Qnil, Qtrue, rb_eRangeError, rb_raise(), and rb_range_values().
Definition at line 67 of file range.c.
References range, range_init(), rb_cRange, and rb_obj_alloc().
Definition at line 963 of file range.c.
References EXCL, id_beg, id_end, Qfalse, Qtrue, RANGE_BEG, RANGE_END, rb_cRange, rb_funcall(), rb_intern, rb_obj_is_kind_of(), rb_respond_to(), and RTEST.
Definition at line 1749 of file rational.c.
References nurat_s_convert(), and rb_cRational.
Definition at line 1741 of file rational.c.
References nurat_s_canonicalize_internal(), and rb_cRational.
Definition at line 1735 of file rational.c.
References nurat_s_new_internal(), and rb_cRational.
Definition at line 1675 of file rational.c.
References CLASS_OF, f_rational_new_no_reduce2(), and get_dat1.
Definition at line 3502 of file file.c.
References chompdirsep(), FilePathValue, Inc, NIL_P, NULL, OBJ_TAINT, Qnil, rb_dir_getwd(), rb_enc_get(), rb_hash_new(), rb_secure(), rb_str_dup_frozen, rb_str_set_len(), rb_str_subseq(), realpath_rec(), RSTRING_GETMEM, and skipprefixroot().
Definition at line 1129 of file eval.c.
References CONST_ID, and rb_attr_get().
Referenced by include_modules_at(), rb_method_entry_make(), and rb_mod_to_s().
| VALUE rb_reg_alloc | ( | void | ) |
Definition at line 2481 of file re.c.
References rb_reg_s_alloc().
Definition at line 1075 of file re.c.
References match_backref_number().
Definition at line 2304 of file re.c.
References buf, err, p, Qnil, rb_enc_get(), RB_GC_GUARD, rb_reg_error_desc(), rb_reg_preprocess(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 2530 of file re.c.
References err, FL_SET, Qnil, rb_reg_alloc(), rb_reg_error_desc(), rb_reg_initialize_str(), rb_set_errinfo(), rb_str_new(), and REG_LITERAL.
Definition at line 2493 of file re.c.
References err, NULL, rb_reg_initialize_str(), and rb_reg_raise_str().
Definition at line 1483 of file re.c.
References rb_reg_nth_match().
Definition at line 2746 of file re.c.
References LONG2FIX, Qnil, rb_str_sublen(), and reg_match_pos().
Definition at line 2805 of file re.c.
References LONG2FIX, Qnil, rb_backref_set(), rb_lastline_get(), rb_reg_search(), rb_str_sublen(), RB_TYPE_P, and T_STRING.
Definition at line 1546 of file re.c.
References BEG, i, match_check(), NIL_P, re_registers::num_regs, Qnil, rb_reg_nth_match(), and RMATCH_REGS.
Definition at line 1528 of file re.c.
References BEG, END, match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_str_subseq(), RMATCH, RMATCH_REGS, and RSTRING_LEN.
Definition at line 1501 of file re.c.
References BEG, match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_str_subseq(), RMATCH, and RMATCH_REGS.
Definition at line 2524 of file re.c.
References rb_ascii8bit_encoding(), and rb_enc_reg_new().
Definition at line 2487 of file re.c.
References rb_reg_alloc(), and rb_reg_init_str().
Definition at line 1439 of file re.c.
References BEG, match_check(), NIL_P, re_registers::num_regs, Qfalse, Qnil, Qtrue, and RMATCH_REGS.
Definition at line 1457 of file re.c.
References BEG, END, re_registers::end, match_check(), NIL_P, re_registers::num_regs, OBJ_INFECT, Qnil, rb_str_subseq(), RMATCH, and RMATCH_REGS.
| int rb_reg_options | ( | VALUE | ) |
Definition at line 3083 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, ARG_REG_OPTION_MASK, KCODE_FIXED, options(), rb_reg_check(), RBASIC, REG_ENCODING_NONE, and RREGEXP.
| int rb_remove_event_hook | ( | rb_event_hook_func_t | func | ) |
Definition at line 194 of file vm_trace.c.
References GET_VM, Qundef, and remove_event_hook().
Definition at line 688 of file vm_method.c.
References rb_intern, and remove_method().
Definition at line 682 of file vm_method.c.
References remove_method().
Definition at line 997 of file load.c.
References OBJ_FREEZE, rb_require_safe(), rb_safe_level, and rb_str_new2.
Definition at line 911 of file load.c.
References rb_thread_struct::errinfo, EXEC_TAG, FilePathValue, GET_THREAD(), JUMP_TAG, load_ext(), load_failed(), load_lock(), load_unlock(), LONG2NUM, NIL_P, POP_TAG, PUSH_TAG, Qfalse, Qnil, Qtrue, rb_ary_push(), rb_load_internal(), rb_provide_feature(), rb_safe_level, rb_set_safe_level_force(), rb_sourcefile, rb_sourceline(), rb_vm_call_cfunc(), rb_vm_top_self(), result, RSTRING_PTR, ruby_dln_librefs, RUBY_DTRACE_FIND_REQUIRE_ENTRY, RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED, RUBY_DTRACE_FIND_REQUIRE_RETURN, RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED, RUBY_DTRACE_REQUIRE_ENTRY, RUBY_DTRACE_REQUIRE_ENTRY_ENABLED, RUBY_DTRACE_REQUIRE_RETURN, RUBY_DTRACE_REQUIRE_RETURN_ENABLED, search_required(), and StringValuePtr.
Definition at line 763 of file eval.c.
References rb_eStandardError, and rb_rescue2().
Referenced by cmp_equal(), do_coerce(), io_close(), and range_init().
Definition at line 701 of file eval.c.
References args, rb_thread_struct::cfp, rb_thread_struct::errinfo, EXEC_TAG, FALSE, GET_THREAD(), JUMP_TAG, POP_TAG, PUSH_TAG, Qnil, rb_obj_is_kind_of(), result, TAG_RAISE, TAG_RETRY, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, TRUE, and va_init_list.
Referenced by argf_getpartial(), check_funcall_missing(), copy_stream_fallback(), gzfile_read_raw(), lazy_zip_func(), path_unlink(), rb_f_loop(), rb_rescue(), tcl2rb_num_or_str(), tkstr_rescue_float(), tkstr_to_number(), and zip_i().
| int rb_reserved_fd_p | ( | int | fd | ) |
Definition at line 16427 of file ripper.c.
References reserved_word().
| void rb_reset_random_seed | ( | void | ) |
Definition at line 1443 of file random.c.
References default_rand, INT2FIX, rb_random_t::mt, rb_random_t::seed, and uninit_genrand.
Definition at line 1557 of file vm_method.c.
References FALSE, and rb_obj_respond_to().
| VALUE* rb_ruby_debug_ptr | ( | void | ) |
Definition at line 2464 of file vm.c.
References GET_VM, and ruby_vm_debug_ptr().
| VALUE* rb_ruby_verbose_ptr | ( | void | ) |
Definition at line 2458 of file vm.c.
References GET_VM, and ruby_vm_verbose_ptr().
| int rb_safe_level | ( | void | ) |
Definition at line 28 of file safe.c.
References GET_THREAD(), and rb_thread_struct::safe_level.
| void rb_secure | ( | int | ) |
Definition at line 79 of file safe.c.
References rb_eSecurityError, rb_frame_callee(), rb_id2name(), rb_raise(), and rb_safe_level.
| void rb_secure_update | ( | VALUE | ) |
Definition at line 94 of file safe.c.
References OBJ_TAINTED, and rb_secure().
Definition at line 303 of file variable.c.
References classid, classpath, ID2SYM, OBJ_FREEZE, rb_cObject, rb_intern, rb_ivar_set(), rb_str_cat2(), rb_str_dup(), rb_str_new2, rb_tmp_class_path(), and tmp_classpath.
Definition at line 280 of file variable.c.
References classid, classpath, ID2SYM, OBJ_FREEZE, rb_cObject, rb_intern_str, rb_ivar_set(), rb_str_append(), rb_str_cat2(), rb_str_dup(), rb_str_new_frozen(), rb_tmp_class_path(), and tmp_classpath.
Definition at line 60 of file eval_jump.c.
References ALLOC, end_proc_data::data, end_procs, ephemeral_end_procs, end_proc_data::func, func, GET_THREAD(), link(), list, end_proc_data::next, rb_safe_level, end_proc_data::safe, and rb_thread_struct::top_wrapper.
Referenced by Init_curses(), Init_tcltklib(), m_core_set_postexe(), and rb_f_at_exit().
| void rb_set_errinfo | ( | VALUE | ) |
Definition at line 1436 of file eval.c.
References err, rb_thread_struct::errinfo, GET_THREAD(), NIL_P, rb_eException, rb_eTypeError, rb_obj_is_kind_of(), and rb_raise().
Referenced by exc_equal(), load_encoding(), name_err_mesg_to_str(), ossl_pem_passwd_cb(), ossl_verify_cb(), pruby_eval(), rb_reg_compile(), reg_compile_gen(), and run_finalizer().
| void rb_set_safe_level | ( | int | ) |
Definition at line 40 of file safe.c.
References GET_THREAD(), rb_thread_struct::safe_level, and SAFE_LEVEL_MAX.
| void rb_set_safe_level_force | ( | int | ) |
Definition at line 34 of file safe.c.
References GET_THREAD(), and rb_thread_struct::safe_level.
| int rb_sigaltstack_size | ( | void | ) |
| const char* rb_sourcefile | ( | void | ) |
Definition at line 802 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, rb_vm_get_ruby_level_next_cfp(), and RSTRING_PTR.
| VALUE rb_sourcefilename | ( | void | ) |
Definition at line 788 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, Qnil, and rb_vm_get_ruby_level_next_cfp().
| int rb_sourceline | ( | void | ) |
Definition at line 816 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD(), rb_vm_get_ruby_level_next_cfp(), and rb_vm_get_sourceline().
| rb_pid_t rb_spawn | ( | int | , |
| VALUE * | |||
| ) |
Definition at line 3724 of file process.c.
References NULL, and rb_spawn_internal().
| rb_pid_t rb_spawn_err | ( | int | , |
| VALUE * | , | ||
| char * | , | ||
| size_t | |||
| ) |
Definition at line 3718 of file process.c.
References rb_spawn_internal().
|
inlinestatic |
Definition at line 1560 of file ruby.h.
References Qfalse, Qtrue, and SPECIAL_CONST_P.
| void rb_stdio_set_default_encoding | ( | void | ) |
Definition at line 871 of file bignum.c.
References rb_str_to_inum().
Definition at line 2114 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, OBJ_INFECT, rb_enc_associate(), rb_enc_check(), rb_str_buf_append(), rb_str_modify_expand(), RSTRING, RSTRING_LEN, RSTRING_PTR, STR_ASSOC_P, and StringValue.
Definition at line 1422 of file string.c.
References add, FL_SET, rb_ary_concat(), rb_check_frozen, RBASIC, RESIZE_CAPA, RSTRING, RSTRING_LEN, STR_ASSOC, STR_ASSOC_P, STR_EMBED_P, str_make_independent, and STR_SHARED_P.
Definition at line 1453 of file string.c.
References Qfalse, RSTRING, STR_ASSOC_P, and STR_SHARED_P.
Definition at line 2098 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, ENCODING_GET, OBJ_INFECT, rb_enc_cr_str_buf_cat(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 1940 of file string.c.
References rb_eArgError, rb_raise(), and str_buf_cat().
Definition at line 1950 of file string.c.
References rb_str_buf_cat(), and strlen().
Definition at line 2074 of file string.c.
References ALLOCA_N, buf, c, ENC_CODERANGE_7BIT, ENC_CODERANGE_VALID, ENCODING_GET, rb_enc_asciicompat, rb_enc_codelen(), rb_enc_cr_str_buf_cat(), rb_enc_from_index(), rb_enc_mbcput, rb_enc_mbmaxlen, and strlen().
| int rb_str_buf_cat_escaped_char | ( | VALUE | result, |
| unsigned int | c, | ||
| int | unicode_p | ||
| ) |
Definition at line 4455 of file string.c.
References buf, CHAR_ESC_LEN, ISPRINT, rb_str_buf_cat(), snprintf, and strlen().
| VALUE rb_str_buf_new | ( | long | ) |
Definition at line 777 of file string.c.
References ALLOC_N, FL_SET, rb_cString, RSTRING, str_alloc(), STR_BUF_MIN_SIZE, and STR_NOEMBED.
Definition at line 793 of file string.c.
References rb_str_buf_cat(), rb_str_buf_new(), and strlen().
| size_t rb_str_capacity | ( | VALUE | ) |
Definition at line 360 of file string.c.
References RSTRING, RSTRING_EMBED_LEN_MAX, STR_EMBED_P, and STR_NOCAPA_P.
Definition at line 1956 of file string.c.
References p, rb_eArgError, rb_raise(), rb_str_buf_cat(), rb_str_modify_expand(), RSTRING, and STR_ASSOC_P.
Definition at line 1975 of file string.c.
References rb_str_cat(), and strlen().
Definition at line 2301 of file string.c.
References ENCODING_GET, lesser, memcmp(), rb_str_comparable(), and RSTRING_GETMEM.
| long rb_str_coderange_scan_restartable | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | , | ||
| int * | |||
| ) |
Definition at line 232 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, p, rb_enc_asciicompat, rb_enc_precise_mbclen(), rb_enc_to_index, and search_nonascii().
Definition at line 2276 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, FALSE, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_str_coderange(), RSTRING_LEN, and TRUE.
Definition at line 2155 of file string.c.
References ALLOCA_N, buf, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, FIX2LONG, FIXNUM_P, ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_ascii8bit_encoding(), rb_enc_associate(), rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_eRangeError, rb_num_to_uint(), rb_raise(), rb_str_append(), rb_str_cat(), rb_str_resize(), RB_TYPE_P, rb_usascii_encoding(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, and T_BIGNUM.
| VALUE rb_str_conv_enc | ( | VALUE | str, |
| rb_encoding * | from, | ||
| rb_encoding * | to | ||
| ) |
Definition at line 563 of file string.c.
References Qnil, and rb_str_conv_enc_opts().
| VALUE rb_str_conv_enc_opts | ( | VALUE | str, |
| rb_encoding * | from, | ||
| rb_encoding * | to, | ||
| int | ecflags, | ||
| VALUE | ecopts | ||
| ) |
Definition at line 3339 of file string.c.
References ELTS_SHARED, ENC_CODERANGE_CLEAR, memmove(), rb_str_new4, RBASIC, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, RSTRING_PTR, str_modifiable(), STR_NOEMBED, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SHARED_P, and xfree.
Definition at line 4622 of file string.c.
References c, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, IS_EVSTR, ISPRINT, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, OnigEncodingTypeST::name, OBJ_INFECT, p, rb_ascii8bit_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_enc_mbc_to_codepoint, rb_enc_precise_mbclen(), rb_str_new5, rb_utf8_encoding(), result, RSTRING_LEN, RSTRING_PTR, snprintf, and strlen().
Definition at line 946 of file string.c.
References rb_obj_class(), and str_duplicate().
Shortens str and adds three dots, an ellipsis, if it is longer than len characters.
| str | the string to ellipsize. |
| len | the maximum string length. |
Definition at line 7701 of file string.c.
References Qnil, rb_eIndexError, rb_enc_asciicompat, rb_enc_associate(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_mbminlen, rb_enc_nth(), rb_enc_step_back, rb_raise(), rb_str_append(), rb_str_cat(), rb_str_encode(), rb_str_new_with_class(), rb_str_subseq(), rb_usascii_str_new(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 2867 of file transcode.c.
References argc, argv, encoded_dup(), and str_transcode0().
Definition at line 230 of file file.c.
References Qnil, rb_ascii8bit_encoding(), rb_enc_associate(), rb_enc_from_encoding(), rb_enc_get(), rb_filesystem_encoding(), rb_str_dup(), rb_str_encode(), rb_utf8_encoding(), and RSTRING_LEN.
Definition at line 2351 of file string.c.
References Qfalse, Qtrue, rb_equal(), rb_intern, rb_respond_to(), RB_TYPE_P, str_eql(), and T_STRING.
Definition at line 620 of file string.c.
References rb_default_external_encoding(), rb_str_conv_enc(), and STR_ENC_GET.
Definition at line 626 of file string.c.
References rb_locale_encoding(), rb_str_conv_enc(), and STR_ENC_GET.
| VALUE rb_str_export_to_enc | ( | VALUE | , |
| rb_encoding * | |||
| ) |
Definition at line 632 of file string.c.
References rb_str_conv_enc(), and STR_ENC_GET.
Definition at line 439 of file sprintf.c.
References arg, argc, argv, BIT_DIGITS, buf, c, CHECK, CHECK_FOR_FLAGS, CHECK_FOR_WIDTH, ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, expr, fbuf, FILL, FIX2LONG, FIXABLE, FIXNUM_P, FMINUS, fmt_setup(), FNONE, FPLUS, FPREC, FPREC0, FSHARP, FSPACE, FWIDTH, FZERO, GETARG, GETASTER, GETNAMEARG, GETNUM, GETPOSARG, hash(), i, ID2SYM, isinf(), isnan, LONG2FIX, NIL_P, NUM2INT, OBJ_TAINT, OBJ_TAINTED, p, PRIdSIZE, PUSH, Qundef, rb_big2str(), rb_big2str0(), rb_big_2comp(), rb_big_clone(), rb_check_id_cstr(), rb_check_string_type(), rb_dbl2big(), rb_eArgError, rb_eKeyError, rb_enc_associate(), rb_enc_check(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_copy(), rb_enc_get(), rb_enc_isprint, rb_enc_mbclen(), rb_enc_mbcput, rb_enc_nth(), rb_enc_raise(), rb_enc_right_char_head, rb_enc_strlen(), rb_enc_toupper(), rb_Float(), RB_GC_GUARD, rb_id2name(), rb_inspect(), rb_int2big(), rb_Integer(), rb_long2int, rb_obj_as_string(), rb_raise(), rb_str_buf_new(), rb_str_coderange_scan_restartable(), rb_str_new4, rb_str_resize(), rb_str_set_len(), rb_str_to_inum(), rb_warn(), rb_warning(), RBIGNUM_SIGN, remove_sign_bits(), result, RFLOAT_VALUE, RSTRING_END, RSTRING_LEN, RSTRING_PTR, RTEST, ruby_debug, ruby_verbose, sign_bits(), snprintf, StringValue, strlen(), T_BIGNUM, T_FIXNUM, T_FLOAT, T_STRING, TRUE, TYPE, v, and val.
| void rb_str_free | ( | VALUE | ) |
Definition at line 830 of file string.c.
References RSTRING, STR_EMBED_P, STR_SHARED_P, and xfree.
Definition at line 1797 of file string.c.
References OBJ_FREEZE, rb_obj_freeze(), RSTRING, and STR_ASSOC_P.
| st_index_t rb_str_hash | ( | VALUE | ) |
Definition at line 2237 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, rb_enc_str_coderange(), rb_memhash(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 2247 of file string.c.
References memcmp(), rb_str_comparable(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 4500 of file string.c.
References buf, c, CHAR_ESC_LEN, ISPRINT, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, NULL, OBJ_INFECT, p, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_codepoint, rb_enc_find(), rb_enc_isascii, rb_enc_isprint, rb_enc_mbc_to_codepoint, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_unicode_p(), rb_str_buf_cat_escaped_char(), rb_str_buf_new(), rb_usascii_encoding(), result, RSTRING_END, RSTRING_PTR, snprintf, str_buf_cat(), str_buf_cat2, STR_ENC_GET, and strlen().
Definition at line 7203 of file string.c.
References id, ID2SYM, RB_GC_GUARD, and rb_intern_str.
Definition at line 1182 of file string.c.
References LONG2NUM, STR_ENC_GET, and str_strlen().
| void rb_str_modify | ( | VALUE | ) |
Definition at line 1369 of file string.c.
References ENC_CODERANGE_CLEAR, str_independent(), and str_make_independent.
| void rb_str_modify_expand | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1377 of file string.c.
References ENC_CODERANGE_CLEAR, rb_eArgError, rb_raise(), REALLOC_N, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, STR_EMBED_P, str_independent(), and str_make_independent_expand().
Definition at line 425 of file string.c.
References rb_cString, and str_new().
Definition at line 447 of file string.c.
References rb_eArgError, rb_raise(), rb_str_new(), and strlen().
Definition at line 713 of file string.c.
References assert, ENCODING_GET, FL_SET, FL_TAINT, FL_UNSET, FL_UNTRUSTED, OBJ_FREEZE, OBJ_FROZEN, OBJ_INFECT, rb_enc_cr_str_exact_copy(), rb_obj_class(), RBASIC, RSTRING, RSTRING_LEN, RSTRING_PTR, STR_ASSOC, STR_ASSOC_P, STR_EMBED_P, str_new(), str_new3(), and STR_SHARED_P.
Definition at line 677 of file string.c.
References OBJ_INFECT, rb_obj_class(), and str_new3().
| long rb_str_offset | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1610 of file string.c.
References RSTRING_END, RSTRING_PTR, single_byte_optimizable(), STR_ENC_GET, and str_offset().
Definition at line 1236 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_AND, ENCODING_CODERANGE_SET, OBJ_TAINT, OBJ_TAINTED, rb_enc_check(), rb_enc_to_index, rb_str_new(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 7820 of file string.c.
References Check_Type, NULL, rb_default_external_encoding(), rb_default_internal_encoding(), rb_str_inspect(), rb_str_is_ascii_only_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, sym_printable(), and T_STRING.
Definition at line 4022 of file string.c.
References str_discard(), str_modifiable(), str_replace(), and StringValue.
Definition at line 1846 of file string.c.
References ENC_CODERANGE_CLEAR, MEMCPY, rb_eArgError, rb_raise(), REALLOC_N, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, STR_EMBED_P, str_independent(), str_make_independent_expand(), STR_NOCAPA_P, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, and xfree.
Definition at line 952 of file string.c.
References rb_cString, rb_sourcefile, rb_sourceline(), RSTRING_LEN, RUBY_DTRACE_STRING_CREATE, RUBY_DTRACE_STRING_CREATE_ENABLED, str_alloc(), and str_replace().
| void rb_str_set_len | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1830 of file string.c.
References rb_bug(), rb_eRuntimeError, rb_raise(), rb_str_capacity(), RSTRING_PTR, str_modifiable(), STR_SET_LEN, and STR_SHARED_P.
Definition at line 7607 of file string.c.
References NIL_P, rb_eTypeError, rb_id2name(), rb_raise(), RB_TYPE_P, and T_STRING.
Definition at line 857 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, FL_SET, OBJ_INFECT, rb_enc_associate(), RBASIC, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, RSTRING_PTR, str_discard(), STR_ENC_GET, STR_NOCAPA, STR_NOCAPA_P, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, and STR_UNSET_NOCAPA.
Definition at line 6123 of file string.c.
References rb_str_new2, rb_str_split_m(), and StringValue.
| long rb_str_strlen | ( | VALUE | ) |
Definition at line 1168 of file string.c.
References STR_ENC_GET, and str_strlen().
| long rb_str_sublen | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1657 of file string.c.
References ENC_CODERANGE, enc_strlen(), RSTRING_PTR, single_byte_optimizable(), and STR_ENC_GET.
Definition at line 1668 of file string.c.
References OBJ_INFECT, rb_enc_cr_str_copy_for_substr(), RB_GC_GUARD, rb_str_drop_bytes(), rb_str_new5, rb_str_new_frozen(), rb_str_new_shared(), RSTRING_EMBED_LEN_MAX, RSTRING_LEN, and RSTRING_PTR.
Definition at line 1774 of file string.c.
References OBJ_INFECT, Qnil, rb_enc_cr_str_copy_for_substr(), RB_GC_GUARD, rb_obj_class(), rb_str_new4, rb_str_new5, rb_str_subpos(), RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_END, and str_new3().
Definition at line 2976 of file string.c.
References c, enc_succ_alnum_char(), enc_succ_char(), ISALPHA, ISDIGIT, MEMCPY, memmove(), NEIGHBOR_FOUND, NEIGHBOR_NOT_CHAR, NEIGHBOR_WRAPPED, OBJ_INFECT, ONIGENC_CODE_TO_MBC_MAXLEN, rb_enc_asciicompat, rb_enc_cr_str_copy_for_substr(), rb_enc_precise_mbclen(), rb_enc_prev_char, rb_enc_str_coderange(), rb_str_new5, RESIZE_CAPA, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, and STR_SET_LEN.
| int rb_str_symname_p | ( | VALUE | ) |
Definition at line 7801 of file string.c.
References FALSE, NULL, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_symname_p(), rb_str_is_ascii_only_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, strlen(), sym_printable(), and TRUE.
Definition at line 1268 of file string.c.
References LONG_MAX, NUM2LONG, OBJ_INFECT, rb_eArgError, rb_enc_cr_str_copy_for_substr(), rb_raise(), rb_str_new5, RSTRING_LEN, and RSTRING_PTR.
| VALUE rb_str_tmp_new | ( | long | ) |
| double rb_str_to_dbl | ( | VALUE | , |
| int | |||
| ) |
Definition at line 2600 of file object.c.
References ALLOCV, ALLOCV_END, MEMCPY, p, rb_cstr_to_dbl(), rb_eArgError, rb_raise(), RSTRING_LEN, RSTRING_PTR, StringValue, and v.
Definition at line 777 of file bignum.c.
References ALLOCV, ALLOCV_END, MEMCPY, p, rb_cstr_to_inum(), rb_must_asciicompat(), RSTRING_LEN, RSTRING_PTR, StringValue, StringValueCStr, and v.
Referenced by fun1(), obj2int(), obj2subsecx(), obj2vint(), rb_convert_to_integer(), rb_str2inum(), rb_str_format(), rb_str_hex(), rb_str_oct(), rb_str_to_i(), rb_str_upto(), and usec2subsecx().
Definition at line 849 of file string.c.
References rb_convert_type(), and T_STRING.
Definition at line 1820 of file string.c.
References FL_TEST, FL_UNSET, rb_eRuntimeError, rb_raise(), and STR_TMPLOCK.
Definition at line 3443 of file string.c.
References rb_str_splice().
Definition at line 1283 of file sprintf.c.
References __SSTR, __SWR, BSD_vfprintf(), f, rb_str_capacity(), rb_str_modify(), rb_str_resize(), RBASIC, RSTRING_END, RSTRING_PTR, ruby__sfvextra(), ruby__sfvwrite(), StringValue, and rb_printf_buffer_extra::value.
Definition at line 2719 of file object.c.
References NIL_P, rb_check_string_type(), rb_convert_type(), and T_STRING.
Definition at line 1472 of file string.c.
References rb_str_to_str(), RB_TYPE_P, and T_STRING.
| char* rb_string_value_cstr | ( | volatile VALUE * | ) |
Definition at line 1490 of file string.c.
References rb_eArgError, rb_raise(), rb_str_modify(), rb_string_value(), RSTRING_LEN, and RSTRING_PTR.
| char* rb_string_value_ptr | ( | volatile VALUE * | ) |
Definition at line 1483 of file string.c.
References rb_string_value(), and RSTRING_PTR.
Definition at line 415 of file struct.c.
References RARRAY_LENINT, RARRAY_PTR, and rb_class_new_instance().
Definition at line 223 of file struct.c.
References struct_alloc().
Definition at line 671 of file struct.c.
References i, NUM2LONG, rb_eIndexError, rb_raise(), rb_struct_aref_id(), rb_to_id(), RB_TYPE_P, RSTRUCT_LEN, RSTRUCT_PTR, T_STRING, and T_SYMBOL.
Definition at line 738 of file struct.c.
References i, NUM2LONG, rb_eIndexError, rb_raise(), rb_struct_aset_id(), rb_struct_modify(), rb_to_id(), RB_TYPE_P, RSTRUCT_LEN, RSTRUCT_PTR, T_STRING, and T_SYMBOL.
Definition at line 264 of file struct.c.
References ID2SYM, make_struct(), Qnil, rb_ary_new(), rb_ary_push(), rb_cStruct, rb_intern, and rb_str_new2.
| VALUE rb_struct_define_without_accessor | ( | const char * | , |
| VALUE | , | ||
| rb_alloc_func_t | , | ||
| ... | |||
| ) |
Definition at line 229 of file struct.c.
References ID2SYM, id_members, name, NULL, OBJ_FREEZE, rb_ary_new2(), rb_ary_push(), rb_class_inherited(), rb_class_new(), rb_define_alloc_func(), rb_define_class(), rb_intern, rb_ivar_set(), rb_make_metaclass(), RBASIC, and struct_alloc().
Definition at line 91 of file struct.c.
References i, ID2SYM, RARRAY_LEN, RARRAY_PTR, rb_id2name(), rb_name_error(), rb_struct_members(), RSTRUCT_PTR, and UNREACHABLE.
Definition at line 620 of file struct.c.
References MEMCPY, OBJ_INIT_COPY, rb_eTypeError, rb_raise(), RSTRUCT_LEN, and RSTRUCT_PTR.
Definition at line 387 of file struct.c.
References RARRAY_LENINT, RARRAY_PTR, and rb_struct_initialize_m().
Definition at line 53 of file struct.c.
References RARRAY_LEN, rb_eTypeError, rb_obj_class(), rb_raise(), rb_struct_s_members(), and RSTRUCT_LEN.
Definition at line 421 of file struct.c.
References args, i, N_REF_FUNC, num_members(), numberof, RARRAY_PTR, rb_ary_tmp_new(), rb_class_new_instance(), rb_long2int, and size.
Definition at line 39 of file struct.c.
References id_members, NIL_P, rb_eTypeError, rb_raise(), RB_TYPE_P, struct_ivar_get(), and T_ARRAY.
Definition at line 344 of file vm_trace.c.
References arg, GET_THREAD(), JUMP_TAG, Qnil, rb_threadptr_reset_raised(), rb_threadptr_set_raised(), result, rb_thread_struct::state, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, rb_thread_struct::trace_arg, rb_vm_struct::trace_running, and rb_thread_struct::vm.
| VALUE rb_sym_all_symbols | ( | void | ) |
Definition at line 16100 of file ripper.c.
References RString::ary, global_symbols, st_table::num_entries, rb_ary_new2(), st_foreach(), symbols::sym_id, and symbols_i().
Referenced by Init_String().
| int rb_sym_interned_p | ( | VALUE | ) |
Definition at line 7898 of file string.c.
References rb_cString, rb_id2str(), str_new3(), and SYM2ID.
| int rb_symname_p | ( | const char * | ) |
Definition at line 15697 of file ripper.c.
References rb_ascii8bit_encoding(), and rb_enc_symname_p().
Definition at line 1873 of file error.c.
References arg, Qnil, rb_str_new2, and rb_syserr_new_str().
Referenced by make_errno_exc(), rb_mod_syserr_fail(), and rb_syserr_fail().
Definition at line 1881 of file error.c.
References get_syserr(), and rb_class_new_instance().
Referenced by make_errno_exc_str(), rb_mod_syserr_fail_str(), rb_syserr_fail_str(), and rb_syserr_new().
| void rb_syswait | ( | rb_pid_t | pid | ) |
Definition at line 3643 of file process.c.
References rb_waitpid().
Definition at line 479 of file string.c.
References OBJ_TAINT, and rb_str_new2.
| int rb_thread_alone | ( | void | ) |
Definition at line 2904 of file thread.c.
References GET_THREAD(), thread_debug, and vm_living_thread_num().
| void rb_thread_atfork | ( | void | ) |
Definition at line 3845 of file thread.c.
References GET_THREAD(), rb_thread_struct::join_list, NULL, rb_reset_random_seed(), rb_thread_atfork_internal(), and terminate_atfork_i().
| void rb_thread_atfork_before_exec | ( | void | ) |
Definition at line 3868 of file thread.c.
References rb_thread_atfork_internal(), and terminate_atfork_before_exec_i().
| void rb_thread_check_ints | ( | void | ) |
Definition at line 1090 of file thread.c.
References GET_THREAD(), and RUBY_VM_CHECK_INTS_BLOCKING.
Definition at line 722 of file thread.c.
References rb_cThread, rb_thread_alloc(), and thread_create_core().
| VALUE rb_thread_current | ( | void | ) |
Definition at line 2350 of file thread.c.
References GET_THREAD(), and rb_thread_struct::self.
| void rb_thread_execute_interrupts | ( | VALUE | th | ) |
Definition at line 1973 of file thread.c.
References GetThreadPtr, and rb_threadptr_execute_interrupts().
| void rb_thread_fd_close | ( | int | ) |
Definition at line 2078 of file thread.c.
References GET_THREAD(), st_foreach(), and thread_fd_close_i().
| int rb_thread_fd_select | ( | int | , |
| rb_fdset_t * | , | ||
| rb_fdset_t * | , | ||
| rb_fdset_t * | , | ||
| struct timeval * | |||
| ) |
Definition at line 3488 of file thread.c.
References do_select(), rb_fd_resize, rb_thread_sleep_forever(), and rb_thread_wait_for().
| int rb_thread_fd_writable | ( | int | ) |
Definition at line 3437 of file thread.c.
References rb_thread_wait_fd_rw(), and TRUE.
| int rb_thread_interrupted | ( | VALUE | thval | ) |
Definition at line 1107 of file thread.c.
References GetThreadPtr, and RUBY_VM_INTERRUPTED.
| VALUE rb_thread_io_blocking_region | ( | rb_blocking_function_t * | func, |
| void * | data1, | ||
| int | fd | ||
| ) |
Definition at line 1331 of file thread.c.
References BLOCKING_REGION, errno, EXEC_TAG, FALSE, func, GET_THREAD(), JUMP_TAG, Qundef, RUBY_VM_CHECK_INTS_BLOCKING, TH_POP_TAG, TH_PUSH_TAG, and rb_thread_struct::waiting_fd.
Definition at line 2133 of file thread.c.
References eKillSignal, EXIT_SUCCESS, GET_THREAD(), GetThreadPtr, rb_vm_struct::main_thread, rb_exit(), rb_secure(), rb_threadptr_interrupt(), rb_threadptr_pending_interrupt_enque(), rb_threadptr_to_kill(), rb_thread_struct::safe_level, rb_thread_struct::status, thread_debug, rb_thread_struct::thread_id, THREAD_KILLED, rb_thread_struct::to_kill, and rb_thread_struct::vm.
Definition at line 2663 of file thread.c.
References GET_THREAD(), GetThreadPtr, rb_thread_struct::local_storage, Qnil, rb_eSecurityError, rb_raise(), rb_safe_level, and st_lookup().
Definition at line 2748 of file thread.c.
References GET_THREAD(), GetThreadPtr, rb_thread_struct::local_storage, NIL_P, OBJ_FROZEN, Qnil, rb_error_frozen(), rb_eSecurityError, rb_raise(), rb_safe_level, st_delete_wrap(), st_init_numtable(), and st_insert().
| VALUE rb_thread_main | ( | void | ) |
Definition at line 2371 of file thread.c.
References GET_THREAD(), rb_vm_struct::main_thread, rb_thread_struct::self, and rb_thread_struct::vm.
| void rb_thread_mark | ( | void * | th | ) |
Definition at line 1788 of file vm.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, rb_thread_struct::event_hooks, rb_thread_struct::fiber, rb_thread_struct::first_args, rb_thread_struct::first_proc, GET_THREAD(), rb_control_frame_struct::iseq, rb_control_frame_struct::klass, rb_thread_struct::last_status, rb_thread_struct::local_storage, rb_thread_struct::locking_mutex, rb_thread_struct::machine_regs, rb_thread_struct::machine_stack_end, rb_thread_struct::machine_stack_start, rb_thread_struct::mark_stack_len, rb_control_frame_struct::me, NULL, rb_thread_struct::pending_interrupt_mask_stack, rb_thread_struct::pending_interrupt_queue, rb_control_frame_struct::proc, rb_objspace::ptr, rb_gc_mark(), rb_gc_mark_locations, rb_gc_mark_machine_stack(), rb_mark_method_entry(), rb_mark_tbl(), rb_thread_struct::root_fiber, rb_thread_struct::root_svar, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_VM_NORMAL_ISEQ_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_iseq_struct::self, rb_control_frame_struct::self, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_size, rb_thread_struct::stat_insn_usage, rb_thread_struct::thgroup, rb_thread_struct::top_self, rb_thread_struct::top_wrapper, rb_thread_struct::value, and vm_trace_mark_event_hooks().
| void rb_thread_recycle_stack_release | ( | VALUE * | ) |
Definition at line 1766 of file vm.c.
References RECYCLE_MAX, and ruby_xfree().
Definition at line 2264 of file thread.c.
References rb_thread_schedule(), and rb_thread_wakeup().
| void rb_thread_schedule | ( | void | ) |
Definition at line 1138 of file thread.c.
References GET_THREAD(), rb_thread_schedule_limits(), rb_threadptr_execute_interrupts(), RUBY_VM_INTERRUPTED_ANY, and UNLIKELY.
Definition at line 4642 of file thread.c.
References DATA_PTR, GetThreadShieldPtr, Qfalse, Qtrue, rb_mutex_unlock(), and rb_thread_shield_waiting.
| VALUE rb_thread_shield_new | ( | void | ) |
Definition at line 4595 of file thread.c.
References DATA_PTR, rb_cThreadShield, rb_mutex_lock(), and thread_shield_alloc().
Definition at line 4631 of file thread.c.
References GetThreadShieldPtr, Qfalse, Qtrue, rb_mutex_unlock(), and rb_thread_shield_waiting.
Definition at line 4611 of file thread.c.
References DATA_PTR, GET_THREAD(), GetMutexPtr, GetThreadShieldPtr, Qfalse, Qnil, Qtrue, rb_mutex_lock(), rb_mutex_unlock(), rb_thread_shield_waiting, rb_thread_shield_waiting_dec(), rb_thread_shield_waiting_inc(), and rb_mutex_struct::th.
| void rb_thread_sleep | ( | int | ) |
Definition at line 1115 of file thread.c.
References INT2FIX, rb_thread_wait_for(), and rb_time_timeval().
| void rb_thread_sleep_forever | ( | void | ) |
Definition at line 1020 of file thread.c.
References GET_THREAD(), sleep_forever(), and thread_debug.
| VALUE rb_thread_stop | ( | void | ) |
Definition at line 2291 of file thread.c.
References Qnil, rb_eThreadError, rb_raise(), rb_thread_alone(), and rb_thread_sleep_deadly().
| void rb_thread_wait_fd | ( | int | ) |
Definition at line 3431 of file thread.c.
References rb_thread_wait_fd_rw().
| void rb_thread_wait_for | ( | struct timeval | ) |
Definition at line 1066 of file thread.c.
References GET_THREAD(), and sleep_timeval().
Definition at line 2220 of file thread.c.
References rb_eThreadError, rb_raise(), rb_thread_wakeup_alive(), and RTEST.
Definition at line 2229 of file thread.c.
References GetThreadPtr, Qnil, rb_threadptr_ready(), rb_thread_struct::status, THREAD_KILLED, THREAD_RUNNABLE, THREAD_STOPPED, and THREAD_STOPPED_FOREVER.
Definition at line 2491 of file time.c.
References time_timeval(), and TRUE.
| VALUE rb_time_nano_new | ( | time_t | , |
| long | |||
| ) |
Definition at line 2389 of file time.c.
References nsec2timew(), and time_new_timew().
| VALUE rb_time_new | ( | time_t | , |
| long | |||
| ) |
Definition at line 2363 of file time.c.
References nsec2timew(), rb_eRangeError, rb_raise(), time_new_timew(), TIMET_MAX, and time_object::timew.
Definition at line 2395 of file time.c.
References NIL_P, rb_time_magnify(), time_new_timew(), time_set_utc_offset(), utc_offset_arg(), v2w(), and validate_utc_offset().
Definition at line 3836 of file time.c.
References GetTimeval, rb_warn(), TIME_COPY_GMT, time_new_timew(), TIME_SCALE, time_object::timew, wadd(), and WINT2FIXWV.
Definition at line 2514 of file time.c.
References FALSE, GetTimeval, IsTimeval, time_timespec(), and timew2timespec().
Definition at line 2497 of file time.c.
References FALSE, GetTimeval, IsTimeval, time_timeval(), timew2timespec(), timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, timeval::tv_usec, TYPEOF_TIMEVAL_TV_SEC, and TYPEOF_TIMEVAL_TV_USEC.
| rb_encoding* rb_to_encoding | ( | VALUE | ) |
Definition at line 194 of file encoding.c.
References enc_check_encoding(), RDATA, and str_to_encoding().
Referenced by decorate_convpath(), dir_initialize(), enc_replicate(), enc_set_default_encoding(), int_chr(), rb_io_extract_encoding_option(), rb_str_force_encoding(), and strio_set_encoding().
| int rb_to_encoding_index | ( | VALUE | ) |
Definition at line 146 of file encoding.c.
References enc_check_encoding(), NIL_P, rb_check_string_type(), rb_enc_asciicompat, rb_enc_find_index(), rb_enc_get(), and StringValueCStr.
Referenced by econv_args(), enc_arg(), enc_names(), lib_fromUTF8_core(), rb_io_extract_encoding_option(), and transcode_io().
Definition at line 2673 of file object.c.
References NIL_P, Qfalse, Qtrue, rb_cNumeric, rb_convert_type(), rb_eTypeError, rb_obj_classname(), rb_obj_is_kind_of(), rb_raise(), RB_TYPE_P, and T_FLOAT.
Definition at line 8146 of file string.c.
References NIL_P, rb_check_string_type(), rb_eTypeError, rb_inspect(), rb_raise(), rb_str_intern(), RSTRING_PTR, SYM2ID, T_STRING, T_SYMBOL, TYPE, and UNREACHABLE.
Definition at line 2412 of file object.c.
References rb_to_integer().
| int rb_tolower | ( | int | c | ) |
Definition at line 1896 of file encoding.c.
References c, ONIGENC_ASCII_CODE_TO_LOWER_CASE, and rb_isascii.
Referenced by readline_attempted_completion_function().
| int rb_toupper | ( | int | c | ) |
Definition at line 1902 of file encoding.c.
References c, ONIGENC_ASCII_CODE_TO_UPPER_CASE, and rb_isascii.
| void rb_trap_exec | ( | void | ) |
| void rb_trap_exit | ( | void | ) |
Definition at line 700 of file signal.c.
References rb_vm_struct::cmd, GET_VM, rb_vm_struct::safe, signal_exec(), and rb_vm_struct::trap_list.
|
inlinestatic |
| int rb_typeddata_inherited_p | ( | const rb_data_type_t * | child, |
| const rb_data_type_t * | parent | ||
| ) |
Definition at line 463 of file error.c.
References rb_data_type_struct::parent.
Referenced by rb_check_typeddata(), and rb_typeddata_is_kind_of().
| int rb_typeddata_is_kind_of | ( | VALUE | , |
| const rb_data_type_t * | |||
| ) |
Definition at line 473 of file error.c.
References RB_TYPE_P, rb_typeddata_inherited_p(), RTYPEDDATA_P, RTYPEDDATA_TYPE, and T_DATA.
Referenced by econv_equal(), enc_check_encoding(), is_kind_of_BigDecimal(), rb_backtrace_p(), rb_dlcfunc2ptr(), rb_dlcfunc_kind_p(), rb_obj_is_fiber(), rb_obj_is_method(), rb_obj_is_mutex(), rb_obj_is_proc(), rb_obj_is_thread(), reachable_objects_from(), and try_get_rnd().
Definition at line 288 of file bignum.c.
References BDIGIT, BDIGIT_DBL, BDIGITS, BIGDN, BIGLO, bignew, DIGSPERLONG, i, and RBIGNUM_SET_LEN.
Referenced by big_split(), bigdivrem(), Init_Bignum(), pack_pack(), pack_unpack(), rb_cstr_to_inum(), rb_int2big(), rb_uint2inum(), rb_uint2num_inline(), and rb_ulong2num_inline().
Definition at line 330 of file bignum.c.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
Referenced by do_checksum(), rb_gzfile_crc(), rb_gzfile_total_in(), rb_gzfile_total_out(), rb_zlib_crc_table(), rb_zstream_adler(), rb_zstream_avail_out(), rb_zstream_total_in(), rb_zstream_total_out(), and zstream_run().
|
inlinestatic |
Definition at line 1181 of file ruby.h.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
|
inlinestatic |
Definition at line 1202 of file ruby.h.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
Definition at line 835 of file vm_method.c.
References attached, c, CALL_METHOD_HOOK, FL_SINGLETON, FL_TEST, cache_entry::klass, cache_entry::me, NIL_P, NOEX_PUBLIC, OBJ_UNTRUSTED, object_id, PRIsVALUE, QUOTE_ID, rb_add_method(), rb_class_name(), rb_cObject, rb_eSecurityError, rb_eTypeError, rb_frozen_class_p(), rb_id2name(), rb_ivar_get(), rb_name_error(), rb_raise(), rb_safe_level, rb_secure(), RB_TYPE_P, rb_vm_cbase(), rb_warn(), search_method(), T_CLASS, T_MODULE, undefined, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_UNDEF.
| void rb_undef_alloc_func | ( | VALUE | ) |
Definition at line 482 of file vm_method.c.
References rb_define_alloc_func(), and UNDEF_ALLOC_FUNC.
Definition at line 5175 of file thread.c.
References GET_THREAD(), rb_thread_struct::pending_interrupt_mask_stack, rb_ary_pop(), rb_ary_push(), rb_cObject, rb_ensure(), rb_hash_aset(), rb_hash_new(), and sym_never.
| void rb_update_max_fd | ( | int | fd | ) |
Definition at line 164 of file io.c.
References ATOMIC_CAS, errno, fstat, max_file_descriptor, rb_bug(), and stat.
| int rb_usascii_encindex | ( | void | ) |
Definition at line 1190 of file encoding.c.
References ENCINDEX_US_ASCII.
Referenced by code_page(), enc_inspect(), id2encidx(), pack_pack(), rb_find_file_ext_safe(), rb_find_file_safe(), rb_locale_encindex(), rb_usascii_str_new(), RUBY_ALIAS_FUNCTION(), transcode_io(), w_encoding(), and w_symbol().
| rb_encoding* rb_usascii_encoding | ( | void | ) |
Definition at line 1181 of file encoding.c.
References enc_table, ENCINDEX_US_ASCII, and rb_enc_init().
Referenced by code_page(), do_opendir(), file_path_convert(), Init_id(), intern_str(), mk_inspect(), of2str(), parser_str_new(), push_glob(), rb_ary_join(), rb_external_str_new_with_enc(), rb_intern2(), rb_nkf_convert(), rb_reg_desc(), rb_reg_initialize(), rb_reg_quote(), rb_str_concat(), rb_str_inspect(), rb_str_upto(), rb_strftime_with_timespec(), reg_fragment_setenc_gen(), setup_exception(), time_asctime(), and time_to_s().
Definition at line 431 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, rb_str_new(), and rb_usascii_encindex().
| int rb_utf8_encindex | ( | void | ) |
Definition at line 1175 of file encoding.c.
References ENCINDEX_UTF_8.
Referenced by id2encidx(), io_strip_bom(), pack_pack(), parse(), rb_char_to_option_kcode(), transcode_io(), transcode_string(), and w_encoding().
| rb_encoding* rb_utf8_encoding | ( | void | ) |
Definition at line 1166 of file encoding.c.
References enc_table, ENCINDEX_UTF_8, and rb_enc_init().
Referenced by alias(), append_utf8(), do_opendir(), env_fetch(), env_str_new(), fix_string_encoding(), get_user_from_path(), Init_nkf(), Init_tcltklib(), load_file_internal(), make_econv_exception(), parser_initialize(), parser_prepare(), parser_str_new(), parser_tokadd_utf8(), rb_f_getenv(), rb_file_expand_path_internal(), rb_memsearch(), rb_str_dump(), rb_str_encode_ospath(), rb_str_subpos(), scalar(), start_document(), start_mapping(), start_sequence(), str_strlen(), and transcode_string().
| int rb_uv_to_utf8 | ( | char | [6], |
| unsigned | long | ||
| ) |
Definition at line 2165 of file pack.c.
References castchar, rb_eRangeError, rb_raise(), and UNREACHABLE.
| VALUE rb_vm_backtrace_object | ( | ) |
Definition at line 532 of file vm_backtrace.c.
References backtrace_object(), and GET_THREAD().
| const void** rb_vm_get_insns_address_table | ( | void | ) |
Definition at line 107 of file vm_exec.c.
References vm_exec_core().
| void rb_vm_mark | ( | void * | ptr | ) |
Definition at line 1549 of file vm.c.
References rb_vm_struct::cmd, rb_vm_struct::coverages, DEFINED_EXPR, rb_vm_struct::defined_strings, rb_vm_struct::event_hooks, rb_vm_struct::expanded_load_path, i, rb_vm_struct::living_threads, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, rb_vm_struct::load_path_snapshot, rb_vm_struct::loaded_features, rb_vm_struct::loaded_features_index, rb_vm_struct::loaded_features_snapshot, rb_vm_struct::loading_table, rb_vm_struct::mark_object_ary, rb_gc_mark(), rb_gc_mark_locations, rb_mark_tbl(), RUBY_GC_INFO, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_NSIG, ruby_special_error_count, rb_vm_struct::special_exceptions, st_foreach(), rb_vm_struct::thgroup_default, rb_vm_struct::top_self, rb_vm_struct::trap_list, vm_mark_each_thread_func(), and vm_trace_mark_event_hooks().
Definition at line 1264 of file sprintf.c.
References NULL, and rb_enc_vsprintf().
| rb_pid_t rb_waitpid | ( | rb_pid_t | pid, |
| int * | status, | ||
| int | flags | ||
| ) |
Definition at line 707 of file process.c.
References errno, GET_THREAD(), wait_data::pid, rb_eArgError, rb_last_status_set(), rb_raise(), rb_thread_alone(), rb_thread_blocking_region(), rb_thread_call_without_gvl(), rb_thread_schedule(), rb_waitpid_blocking(), result, RUBY_UBF_PROCESS, RUBY_VM_CHECK_INTS, st_delete(), st_foreach(), st_init_numtable(), st_insert(), wait_data::status, and wait_each().
| void rb_write_error | ( | const char * | ) |
Definition at line 7021 of file io.c.
References rb_write_error2(), and strlen().
| void rb_write_error2 | ( | const char * | , |
| long | |||
| ) |
Definition at line 7007 of file io.c.
References rb_io_t::fd, orig_stderr, rb_io_write(), rb_stderr, rb_str_new(), and RFILE.
| void rb_write_error_str | ( | VALUE | mesg | ) |
Definition at line 7027 of file io.c.
References rb_io_t::fd, orig_stderr, RB_GC_GUARD, rb_io_write(), rb_stderr, RFILE, RSTRING_LEN, and RSTRING_PTR.
Definition at line 934 of file vm_eval.c.
References Qundef, and rb_yield_0().
Definition at line 973 of file vm_eval.c.
References NIL_P, RARRAY_LENINT, RARRAY_PTR, rb_check_array_type(), rb_eArgError, rb_raise(), rb_yield_0(), and v.
| VALUE rb_yield_values | ( | int | n, |
| ... | |||
| ) |
Definition at line 945 of file vm_eval.c.
References ALLOCA_N, args, argv, i, rb_yield_0(), and va_init_list.
Definition at line 967 of file vm_eval.c.
References rb_yield_0().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN double round | ( | double | ) |
| int ruby_brace_glob | ( | const char * | , |
| int | , | ||
| ruby_glob_func * | , | ||
| VALUE | |||
| ) |
Definition at line 1672 of file dir.c.
References GLOB_VERBOSE, rb_ascii8bit_encoding(), and ruby_brace_glob0().
Referenced by cmdglob().
| const char* ruby_enc_find_basename | ( | const char * | name, |
| long * | baselen, | ||
| long * | alllen, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 3654 of file file.c.
References chompdirsep(), Inc, isdirsep, name, p, skipprefix, strlen(), and strrdirsep.
| const char* ruby_enc_find_extname | ( | const char * | name, |
| long * | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 3847 of file file.c.
References Inc, isdirsep, istrailinggarbage, last, name, p, strlen(), and strrdirsep.
| void ruby_error_print | ( | void | ) |
| double ruby_float_mod | ( | double | x, |
| double | y | ||
| ) |
Definition at line 903 of file numeric.c.
References flodivmod(), and mod.
| int ruby_glob | ( | const char * | , |
| int | , | ||
| ruby_glob_func * | , | ||
| VALUE | |||
| ) |
Definition at line 1537 of file dir.c.
References GLOB_VERBOSE, rb_ascii8bit_encoding(), and ruby_glob0().
| void ruby_set_inplace_mode | ( | const char * | ) |
| const char* ruby_signal_name | ( | int | ) |
Definition at line 237 of file signal.c.
References signo2signm().
| unsigned long ruby_strtoul | ( | const char * | str, |
| char ** | endptr, | ||
| int | base | ||
| ) |
| int ruby_vsnprintf | ( | char * | str, |
| size_t | n, | ||
| char const * | fmt, | ||
| va_list | ap | ||
| ) |
Definition at line 1285 of file vsnprintf.c.
References __SSTR, __SWR, __sbuf::_base, __sFILE::_bf, __sFILE::_flags, __sFILE::_p, __sbuf::_size, __sFILE::_w, BSD__sfvwrite(), BSD_vfprintf(), EOF, f, __sFILE::vextra, and __sFILE::vwrite.
| RUBY_EXTERN void setproctitle | ( | const char * | fmt, |
| ... | |||
| ) |
Definition at line 135 of file setproctitle.c.
References NULL, SPT_PADCHAR, strlcpy(), strlen(), and vsnprintf.
|
static |
| RUBY_EXTERN int signbit | ( | double | x | ) |
Definition at line 624 of file st.c.
References add_direct(), add_packed_direct(), do_hash, st_table::entries_packed, and st_table::num_bins.
Definition at line 797 of file st.c.
References st_table::bins, st_table::entries_packed, i, st_table_entry::key, last, st_table_entry::next, st_table::num_bins, st_table::num_entries, PACKED_ENT, PKEY, st_table::real_entries, and st_free_entry.
| void st_clear | ( | st_table * | ) |
Definition at line 308 of file st.c.
References st_table::bins, st_table::entries_packed, st_table::head, i, st_table_entry::next, st_table::num_bins, st_table::num_entries, st_table::real_entries, st_free_entry, and st_table::tail.
Definition at line 658 of file st.c.
References st_table_entry::back, st_table::bins, st_table::entries_packed, st_table_entry::fore, st_table_entry::hash, st_table::head, MEMCPY, st_table_entry::next, st_table::num_bins, st_alloc_bins, st_alloc_entry, st_alloc_table, st_dealloc_table, st_free_table(), and st_table::tail.
Definition at line 1000 of file st.c.
References arg, st_table::bins, st_table::entries_packed, FIND_ENTRY, st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CHECK, ST_CONTINUE, ST_DELETE, st_free_entry, ST_STOP, and val.
Definition at line 909 of file st.c.
References arg, st_table::bins, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_safe_packed_entry(), ST_CHECK, ST_CONTINUE, ST_DELETE, ST_STOP, and val.
Definition at line 133 of file hash.c.
References foreach_safe_arg::arg, foreach_safe_i(), func, foreach_safe_arg::func, rb_eRuntimeError, rb_raise(), st_foreach_check(), and foreach_safe_arg::tbl.
| void st_free_table | ( | st_table * | ) |
Definition at line 334 of file st.c.
References st_table::bins, st_table::num_bins, st_clear(), st_dealloc_table, and st_free_bins.
| st_index_t st_hash | ( | const void * | ptr, |
| size_t | len, | ||
| st_index_t | h | ||
| ) |
Definition at line 1313 of file st.c.
References CHAR_BIT, murmur_finish(), murmur_step, MurmurMagic, SIZEOF_ST_INDEX_T, and UNALIGNED_ADD_ALL.
| st_index_t st_hash_end | ( | st_index_t | h | ) |
Definition at line 1477 of file st.c.
References murmur_step.
| st_index_t st_hash_start | ( | st_index_t | h | ) |
Definition at line 1486 of file st.c.
References st_hash_start.
| st_index_t st_hash_uint | ( | st_index_t | h, |
| st_index_t | i | ||
| ) |
| st_index_t st_hash_uint32 | ( | st_index_t | h, |
| uint32_t | i | ||
| ) |
Definition at line 1440 of file st.c.
References murmur_step.
| st_table* st_init_numtable | ( | void | ) |
Definition at line 272 of file st.c.
References st_init_table(), and type_numhash.
| st_table* st_init_numtable_with_size | ( | st_index_t | ) |
Definition at line 278 of file st.c.
References st_init_table_with_size(), and type_numhash.
| st_table* st_init_strcasetable | ( | void | ) |
Definition at line 296 of file st.c.
References st_init_table().
| st_table* st_init_strcasetable_with_size | ( | st_index_t | ) |
Definition at line 302 of file st.c.
References st_init_table_with_size().
| st_table* st_init_strtable | ( | void | ) |
Definition at line 284 of file st.c.
References st_init_table().
| st_table* st_init_strtable_with_size | ( | st_index_t | ) |
Definition at line 290 of file st.c.
References st_init_table_with_size().
| st_table* st_init_table | ( | const struct st_hash_type * | ) |
Definition at line 266 of file st.c.
References st_init_table_with_size().
| st_table* st_init_table_with_size | ( | const struct st_hash_type * | , |
| st_index_t | |||
| ) |
Definition at line 229 of file st.c.
References st_table::bins, st_table::entries_packed, getenv(), st_table::head, MAX_PACKED_HASH, new_size(), st_table::num_bins, st_table::num_entries, size, st_alloc_bins, st_alloc_table, ST_DEFAULT_PACKED_TABLE_SIZE, st_table::tail, st_table::type, and type.
Definition at line 342 of file st.c.
References st_table::entries_packed, st_table::num_bins, and st_table::num_entries.
| st_index_t st_numhash | ( | st_data_t | ) |
| int st_update | ( | st_table * | table, |
| st_data_t | key, | ||
| st_update_callback_func * | func, | ||
| st_data_t | arg | ||
| ) |
Definition at line 834 of file st.c.
References add_direct(), add_packed_direct(), arg, st_table::bins, do_hash, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, i, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PKEY, PVAL, PVAL_SET, real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CONTINUE, ST_DELETE, and st_free_entry.
| RUBY_EXTERN char* strchr | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN char* strerror | ( | int | ) |
Definition at line 11 of file strerror.c.
References msg, and sys_errlist.
| RUBY_EXTERN size_t strlcat | ( | char * | , |
| const char * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN size_t strlcpy | ( | char * | , |
| const char * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN char* strrchr | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN char* strstr | ( | const char * | , |
| const char * | |||
| ) |
| switch | ( | c | ) |
Definition at line 7601 of file parse.y.
References lex_strterm, NEW_STRTERM, pushback, str_dsym, and str_ssym.
| RUBY_EXTERN double tgamma | ( | double | ) |
|
static |
|
static |
|
static |
Definition at line 859 of file vm_backtrace.c.
References thread_backtrace_to_ary().
Definition at line 865 of file vm_backtrace.c.
References thread_backtrace_to_ary().
|
static |
|
static |
| warn_balanced | ( | "/" | , |
| "regexp literal" | |||
| ) |
| void* xcalloc | ( | size_t | , |
| size_t | |||
| ) |
| void* xcalloc | ( | size_t | , |
| size_t | |||
| ) |
| void xfree | ( | void * | ) |
| void xfree | ( | void * | ) |
| void* xmalloc | ( | size_t | ) |
| void* xmalloc2 | ( | size_t | , |
| size_t | |||
| ) |
| void* xmalloc2 | ( | size_t | , |
| size_t | |||
| ) |
| void* xrealloc | ( | void * | , |
| size_t | |||
| ) |
| void* xrealloc | ( | void * | , |
| size_t | |||
| ) |
| void* xrealloc2 | ( | void * | , |
| size_t | , | ||
| size_t | |||
| ) |
| void* xrealloc2 | ( | void * | , |
| size_t | , | ||
| size_t | |||
| ) |
|
static |
| mlhs_inner __pad14__ |
| primary_value [' opt_call_args rbracket { $$ = aryset($1, $3); } | primary_value '.' tIDENTIFIER { $$ = attrset($1, $3); } | primary_value tCOLON2 tIDENTIFIER { $$ = attrset($1, $3); } | primary_value '.' tCONSTANT { $$ = attrset($1, $3); } | primary_value tCOLON2 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3)); } | tCOLON3 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON3($2)); } | backref { rb_backref_error($1); $$ = NEW_BEGIN(0); } ;lhs : user_variable { $$ = assignable($1, 0); if (!$$) $$ = NEW_BEGIN(0); } | keyword_variable { $$ = assignable($1, 0); if (!$$) $$ = NEW_BEGIN(0); } | primary_value '[' opt_call_args rbracket { $$ = aryset($1, $3); } | primary_value '.' tIDENTIFIER { $$ = attrset($1, $3); } | primary_value tCOLON2 tIDENTIFIER { $$ = attrset($1, $3); } | primary_value '.' tCONSTANT { $$ = attrset($1, $3); } | primary_value tCOLON2 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3)); } | tCOLON3 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON3($2)); } | backref { rb_backref_error($1); $$ = NEW_BEGIN(0); } ;cname : tIDENTIFIER { yyerror("class/module name must be CONSTANT"); } | tCONSTANT ;cpath : tCOLON3 cname { $$ = NEW_COLON3($2); } | cname { $$ = NEW_COLON2(0, $$); } | primary_value tCOLON2 cname { $$ = NEW_COLON2($1, $3); } ;fname : tIDENTIFIER | tCONSTANT | tFID | op { lex_state = EXPR_ENDFN; $$ = $1; } | reswords { lex_state = EXPR_ENDFN; $$ = $<id>1; } ;fsym : fname | symbol ;fitem : fsym { $$ = NEW_LIT(ID2SYM($1)); } | dsym ;undef_list : fitem { $$ = NEW_UNDEF($1); } | undef_list ',' {lex_state = EXPR_FNAME;} fitem { $$ = block_append($1, NEW_UNDEF($4)); } ;op : '|' { ifndef_ripper($$ = '|'); } | '^' { ifndef_ripper($$ = '^'); } | '&' { ifndef_ripper($$ = '&'); } | tCMP { ifndef_ripper($$ = tCMP); } | tEQ { ifndef_ripper($$ = tEQ); } | tEQQ { ifndef_ripper($$ = tEQQ); } | tMATCH { ifndef_ripper($$ = tMATCH); } | tNMATCH { ifndef_ripper($$ = tNMATCH); } | '>' { ifndef_ripper($$ = '>'); } | tGEQ { ifndef_ripper($$ = tGEQ); } | '<' { ifndef_ripper($$ = '<'); } | tLEQ { ifndef_ripper($$ = tLEQ); } | tNEQ { ifndef_ripper($$ = tNEQ); } | tLSHFT { ifndef_ripper($$ = tLSHFT); } | tRSHFT { ifndef_ripper($$ = tRSHFT); } | '+' { ifndef_ripper($$ = '+'); } | '-' { ifndef_ripper($$ = '-'); } | '*' { ifndef_ripper($$ = '*'); } | tSTAR { ifndef_ripper($$ = '*'); } | '/' { ifndef_ripper($$ = '/'); } | '%' { ifndef_ripper($$ = '%'); } | tPOW { ifndef_ripper($$ = tPOW); } | tDSTAR { ifndef_ripper($$ = tDSTAR); } | '!' { ifndef_ripper($$ = '!'); } | '~' { ifndef_ripper($$ = '~'); } | tUPLUS { ifndef_ripper($$ = tUPLUS); } | tUMINUS { ifndef_ripper($$ = tUMINUS); } | tAREF { ifndef_ripper($$ = tAREF); } | tASET { ifndef_ripper($$ = tASET); } | '`' { ifndef_ripper($$ = '`'); } ;reswords : keyword__LINE__ | keyword__FILE__ | keyword__ENCODING__ | keyword_BEGIN | keyword_END | keyword_alias | keyword_and | keyword_begin | keyword_break | keyword_case | keyword_class | keyword_def | keyword_defined | keyword_do | keyword_else | keyword_elsif | keyword_end | keyword_ensure | keyword_false | keyword_for | keyword_in | keyword_module | keyword_next | keyword_nil | keyword_not | keyword_or | keyword_redo | keyword_rescue | keyword_retry | keyword_return | keyword_self | keyword_super | keyword_then | keyword_true | keyword_undef | keyword_when | keyword_yield | keyword_if | keyword_unless | keyword_while | keyword_until ;arg : lhs '=' arg { value_expr($3); $$ = node_assign($1, $3); } | lhs '=' arg modifier_rescue arg { value_expr($3); $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0); $$ = node_assign($1, $3); } | var_lhs tOP_ASGN arg { value_expr($3); $$ = new_op_assign($1, $2, $3); } | var_lhs tOP_ASGN arg modifier_rescue arg { value_expr($3); $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0); $$ = new_op_assign($1, $2, $3); } | primary_value '[' opt_call_args rbracket tOP_ASGN arg { NODE *args; value_expr($6); if (!$3) $3 = NEW_ZARRAY(); if (nd_type($3) == NODE_BLOCK_PASS) { args = NEW_ARGSCAT($3, $6); } else { args = arg_concat($3, $6); } if ($5 == tOROP) { $5 = 0; } else if ($5 == tANDOP) { $5 = 1; } $$ = NEW_OP_ASGN1($1, $5, args); fixpos($$, $1); } | primary_value '.' tIDENTIFIER tOP_ASGN arg { value_expr($5); $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); } | primary_value '.' tCONSTANT tOP_ASGN arg { value_expr($5); $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); } | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg { value_expr($5); $$ = new_attr_op_assign($1, ripper_intern("::"), $3, $4, $5); } | primary_value tCOLON2 tCONSTANT tOP_ASGN arg { $$ = NEW_COLON2($1, $3); $$ = new_const_op_assign($$, $4, $5); } | tCOLON3 tCONSTANT tOP_ASGN arg { $$ = NEW_COLON3($2); $$ = new_const_op_assign($$, $3, $4); } | backref tOP_ASGN arg { rb_backref_error($1); $$ = NEW_BEGIN(0); } | arg tDOT2 arg { value_expr($1); value_expr($3); $$ = NEW_DOT2($1, $3); if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { deferred_nodes = list_append(deferred_nodes, $$); } } | arg tDOT3 arg { value_expr($1); value_expr($3); $$ = NEW_DOT3($1, $3); if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { deferred_nodes = list_append(deferred_nodes, $$); } } | arg '+' arg { $$ = call_bin_op($1, '+', $3); } | arg '-' arg { $$ = call_bin_op($1, '-', $3); } | arg '*' arg { $$ = call_bin_op($1, '*', $3); } | arg '/' arg { $$ = call_bin_op($1, '/', $3); } | arg '%' arg { $$ = call_bin_op($1, '%', $3); } | arg tPOW arg { $$ = call_bin_op($1, tPOW, $3); } | tUMINUS_NUM tINTEGER tPOW arg { $$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0); } | tUMINUS_NUM tFLOAT tPOW arg { $$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0); } | tUPLUS arg { $$ = call_uni_op($2, tUPLUS); } | tUMINUS arg { $$ = call_uni_op($2, tUMINUS); } | arg '|' arg { $$ = call_bin_op($1, '|', $3); } | arg '^' arg { $$ = call_bin_op($1, '^', $3); } | arg '&' arg { $$ = call_bin_op($1, '&', $3); } | arg tCMP arg { $$ = call_bin_op($1, tCMP, $3); } | arg '>' arg { $$ = call_bin_op($1, '>', $3); } | arg tGEQ arg { $$ = call_bin_op($1, tGEQ, $3); } | arg '<' arg { $$ = call_bin_op($1, '<', $3); } | arg tLEQ arg { $$ = call_bin_op($1, tLEQ, $3); } | arg tEQ arg { $$ = call_bin_op($1, tEQ, $3); } | arg tEQQ arg { $$ = call_bin_op($1, tEQQ, $3); } | arg tNEQ arg { $$ = call_bin_op($1, tNEQ, $3); } | arg tMATCH arg { $$ = match_op($1, $3); if (nd_type($1) == NODE_LIT && RB_TYPE_P($1->nd_lit, T_REGEXP)) { $$ = reg_named_capture_assign($1->nd_lit, $$); } } | arg tNMATCH arg { $$ = call_bin_op($1, tNMATCH, $3); } | '!' arg { $$ = call_uni_op(cond($2), '!'); } | '~' arg { $$ = call_uni_op($2, '~'); } | arg tLSHFT arg { $$ = call_bin_op($1, tLSHFT, $3); } | arg tRSHFT arg { $$ = call_bin_op($1, tRSHFT, $3); } | arg tANDOP arg { $$ = logop(NODE_AND, $1, $3); } | arg tOROP arg { $$ = logop(NODE_OR, $1, $3); } | keyword_defined opt_nl {in_defined = 1;} arg { in_defined = 0; $$ = NEW_DEFINED($4); } | arg '?' arg opt_nl ':' arg { value_expr($1); $$ = NEW_IF(cond($1), $3, $6); fixpos($$, $1); } | primary { $$ = $1; } ;arg_value : arg { value_expr($1); $$ = $1; if (!$$) $$ = NEW_NIL(); } ;aref_args : none | args trailer { $$ = $1; } | args ',' assocs trailer { $$ = arg_append($1, NEW_HASH($3)); } | assocs trailer { $$ = NEW_LIST(NEW_HASH($1)); } ;paren_args : '(' opt_call_args rparen { $$ = $2; } ;opt_paren_args : none | paren_args ;opt_call_args : none | call_args | args ',' { $$ = $1; } | args ',' assocs ',' { $$ = arg_append($1, NEW_HASH($3)); } | assocs ',' { $$ = NEW_LIST(NEW_HASH($1)); } ;call_args : command { value_expr($1); $$ = NEW_LIST($1); } | args opt_block_arg { $$ = arg_blk_pass($1, $2); } | assocs opt_block_arg { $$ = NEW_LIST(NEW_HASH($1)); $$ = arg_blk_pass($$, $2); } | args ',' assocs opt_block_arg { $$ = arg_append($1, NEW_HASH($3)); $$ = arg_blk_pass($$, $4); } | block_arg ;command_args : { $<val>$ = cmdarg_stack; CMDARG_PUSH(1); } call_args { cmdarg_stack = $<val>1; $$ = $2; } ;block_arg : tAMPER arg_value { $$ = NEW_BLOCK_PASS($2); } ;opt_block_arg : ',' block_arg { $$ = $2; } | none { $$ = 0; } ;args : arg_value { $$ = NEW_LIST($1); } | tSTAR arg_value { $$ = NEW_SPLAT($2); } | args ',' arg_value { NODE *n1; if ((n1 = splat_array($1)) != 0) { $$ = list_append(n1, $3); } else { $$ = arg_append($1, $3); } } | args ',' tSTAR arg_value { NODE *n1; if ((nd_type($4) == NODE_ARRAY) && (n1 = splat_array($1)) != 0) { $$ = list_concat(n1, $4); } else { $$ = arg_concat($1, $4); } } ;mrhs : args ',' arg_value { NODE *n1; if ((n1 = splat_array($1)) != 0) { $$ = list_append(n1, $3); } else { $$ = arg_append($1, $3); } } | args ',' tSTAR arg_value { NODE *n1; if (nd_type($4) == NODE_ARRAY && (n1 = splat_array($1)) != 0) { $$ = list_concat(n1, $4); } else { $$ = arg_concat($1, $4); } } | tSTAR arg_value { $$ = NEW_SPLAT($2); } ;primary : literal | strings | xstring | regexp | words | qwords | symbols | qsymbols | var_ref | backref | tFID { $$ = NEW_FCALL($1, 0); } | k_begin { $<val>1 = cmdarg_stack; cmdarg_stack = 0; $<num>$ = ruby_sourceline; } bodystmt k_end { cmdarg_stack = $<val>1; if ($3 == NULL) { $$ = NEW_NIL(); } else { if (nd_type($3) == NODE_RESCUE || nd_type($3) == NODE_ENSURE) nd_set_line($3, $<num>2); $$ = NEW_BEGIN($3); } nd_set_line($$, $<num>2); } | tLPAREN_ARG {lex_state = EXPR_ENDARG;} rparen { $$ = 0; } | tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} rparen { $$ = $2; } | tLPAREN compstmt ')' { $$ = $2; } | primary_value tCOLON2 tCONSTANT { $$ = NEW_COLON2($1, $3); } | tCOLON3 tCONSTANT { $$ = NEW_COLON3($2); } | tLBRACK aref_args ']' { if ($2 == 0) { $$ = NEW_ZARRAY(); } else { $$ = $2; } } | tLBRACE assoc_list '}' { $$ = NEW_HASH($2); } | keyword_return { $$ = NEW_RETURN(0); } | keyword_yield '(' call_args rparen { $$ = new_yield($3); } | keyword_yield '(' rparen { $$ = NEW_YIELD(0); } | keyword_yield { $$ = NEW_YIELD(0); } | keyword_defined opt_nl '(' {in_defined = 1;} expr rparen { in_defined = 0; $$ = NEW_DEFINED($5); } | keyword_not '(' expr rparen { $$ = call_uni_op(cond($3), '!'); } | keyword_not '(' rparen { $$ = call_uni_op(cond(NEW_NIL()), '!'); } | fcall brace_block { $2->nd_iter = $1; $$ = $2; } | method_call | method_call brace_block { block_dup_check($1->nd_args, $2); $2->nd_iter = $1; $$ = $2; } | tLAMBDA lambda { $$ = $2; } | k_if expr_value then compstmt if_tail k_end { $$ = NEW_IF(cond($2), $4, $5); fixpos($$, $2); } | k_unless expr_value then compstmt opt_else k_end { $$ = NEW_UNLESS(cond($2), $4, $5); fixpos($$, $2); } | k_while {COND_PUSH(1);} expr_value do {COND_POP();} compstmt k_end { $$ = NEW_WHILE(cond($3), $6, 1); fixpos($$, $3); } | k_until {COND_PUSH(1);} expr_value do {COND_POP();} compstmt k_end { $$ = NEW_UNTIL(cond($3), $6, 1); fixpos($$, $3); } | k_case expr_value opt_terms case_body k_end { $$ = NEW_CASE($2, $4); fixpos($$, $2); } | k_case opt_terms case_body k_end { $$ = NEW_CASE(0, $3); } | k_for for_var keyword_in {COND_PUSH(1);} expr_value do {COND_POP();} compstmt k_end { ID id = internal_id(); ID *tbl = ALLOC_N(ID, 2); NODE *m = NEW_ARGS_AUX(0, 0); NODE *args, *scope; if (nd_type($2) == NODE_MASGN) { NODE *one = NEW_LIST(NEW_LIT(INT2FIX(1))); NODE *zero = NEW_LIST(NEW_LIT(INT2FIX(0))); m->nd_next = block_append( NEW_IF( NEW_NODE(NODE_AND, NEW_CALL(NEW_CALL(NEW_DVAR(id), idLength, 0), idEq, one), NEW_CALL(NEW_CALL(NEW_DVAR(id), idAREF, zero), rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))), 0), NEW_DASGN_CURR(id, NEW_CALL(NEW_DVAR(id), idAREF, zero)), 0), node_assign($2, NEW_DVAR(id))); args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); } else { if (nd_type($2) == NODE_LASGN || nd_type($2) == NODE_DASGN || nd_type($2) == NODE_DASGN_CURR) { $2->nd_value = NEW_DVAR(id); m->nd_plen = 1; m->nd_next = $2; args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0)); } else { m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id)); args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); } } scope = NEW_NODE(NODE_SCOPE, tbl, $8, args); tbl[0] = 1; tbl[1] = id; $$ = NEW_FOR(0, $5, scope); fixpos($$, $2); } | k_class cpath superclass { if (in_def || in_single) yyerror("class definition in method body"); local_push(0); $<num>$ = ruby_sourceline; } bodystmt k_end { $$ = NEW_CLASS($2, $5, $3); nd_set_line($$, $<num>4); local_pop(); } | k_class tLSHFT expr { $<num>$ = in_def; in_def = 0; } term { $<num>$ = in_single; in_single = 0; local_push(0); } bodystmt k_end { $$ = NEW_SCLASS($3, $7); fixpos($$, $3); local_pop(); in_def = $<num>4; in_single = $<num>6; } | k_module cpath { if (in_def || in_single) yyerror("module definition in method body"); local_push(0); $<num>$ = ruby_sourceline; } bodystmt k_end { $$ = NEW_MODULE($2, $4); nd_set_line($$, $<num>3); local_pop(); } | k_def fname { $<id>$ = cur_mid; cur_mid = $2; in_def++; local_push(0); } f_arglist bodystmt k_end { NODE *body = remove_begin($5); reduce_nodes(&body); $$ = NEW_DEFN($2, $4, body, NOEX_PRIVATE); nd_set_line($$, $<num>1); local_pop(); in_def--; cur_mid = $<id>3; } | k_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname { in_single++; lex_state = EXPR_ENDFN; local_push(0); } f_arglist bodystmt k_end { NODE *body = remove_begin($8); reduce_nodes(&body); $$ = NEW_DEFS($2, $5, $7, body); nd_set_line($$, $<num>1); local_pop(); in_single--; } | keyword_break { $$ = NEW_BREAK(0); } | keyword_next { $$ = NEW_NEXT(0); } | keyword_redo { $$ = NEW_REDO(); } | keyword_retry { $$ = NEW_RETRY(); } ;primary_value : primary { value_expr($1); $$ = $1; if (!$$) $$ = NEW_NIL(); } ;k_begin : keyword_begin { token_info_push("begin"); } ;k_if : keyword_if { token_info_push("if"); } ;k_unless : keyword_unless { token_info_push("unless"); } ;k_while : keyword_while { token_info_push("while"); } ;k_until : keyword_until { token_info_push("until"); } ;k_case : keyword_case { token_info_push("case"); } ;k_for : keyword_for { token_info_push("for"); } ;k_class : keyword_class { token_info_push("class"); } ;k_module : keyword_module { token_info_push("module"); } ;k_def : keyword_def { token_info_push("def"); $<num>$ = ruby_sourceline; } ;k_end : keyword_end { token_info_pop("end"); } ;then : term | keyword_then | term keyword_then ;do : term | keyword_do_cond ;if_tail : opt_else | keyword_elsif expr_value then compstmt if_tail { $$ = NEW_IF(cond($2), $4, $5); fixpos($$, $2); } ;opt_else : none | keyword_else compstmt { $$ = $2; } ;for_var : lhs | mlhs ;f_marg : f_norm_arg { $$ = assignable($1, 0); } | tLPAREN f_margs rparen { $$ = $2; } ;f_marg_list : f_marg { $$ = NEW_LIST($1); } | f_marg_list ',' f_marg { $$ = list_append($1, $3); } ;f_margs : f_marg_list { $$ = NEW_MASGN($1, 0); } | f_marg_list ',' tSTAR f_norm_arg { $$ = assignable($4, 0); $$ = NEW_MASGN($1, $$); } | f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list { $$ = assignable($4, 0); $$ = NEW_MASGN($1, NEW_POSTARG($$, $6)); } | f_marg_list ',' tSTAR { $$ = NEW_MASGN($1, -1); } | f_marg_list ',' tSTAR ',' f_marg_list { $$ = NEW_MASGN($1, NEW_POSTARG(-1, $5)); } | tSTAR f_norm_arg { $$ = assignable($2, 0); $$ = NEW_MASGN(0, $$); } | tSTAR f_norm_arg ',' f_marg_list { $$ = assignable($2, 0); $$ = NEW_MASGN(0, NEW_POSTARG($$, $4)); } | tSTAR { $$ = NEW_MASGN(0, -1); } | tSTAR ',' f_marg_list { $$ = NEW_MASGN(0, NEW_POSTARG(-1, $3)); } ;block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg { $$ = new_args_tail($1, $3, $4); } | f_block_kwarg opt_f_block_arg { $$ = new_args_tail($1, Qnone, $2); } | f_kwrest opt_f_block_arg { $$ = new_args_tail(Qnone, $1, $2); } | f_block_arg { $$ = new_args_tail(Qnone, Qnone, $1); } ;opt_block_args_tail : ',' block_args_tail { $$ = $2; } | { $$ = new_args_tail(Qnone, Qnone, Qnone); } ;block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail { $$ = new_args($1, $3, $5, Qnone, $6); } | f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args($1, $3, $5, $7, $8); } | f_arg ',' f_block_optarg opt_block_args_tail { $$ = new_args($1, $3, Qnone, Qnone, $4); } | f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail { $$ = new_args($1, $3, Qnone, $5, $6); } | f_arg ',' f_rest_arg opt_block_args_tail { $$ = new_args($1, Qnone, $3, Qnone, $4); } | f_arg ',' { $$ = new_args($1, Qnone, 1, Qnone, new_args_tail(Qnone, Qnone, Qnone)); } | f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args($1, Qnone, $3, $5, $6); } | f_arg opt_block_args_tail { $$ = new_args($1, Qnone, Qnone, Qnone, $2); } | f_block_optarg ',' f_rest_arg opt_block_args_tail { $$ = new_args(Qnone, $1, $3, Qnone, $4); } | f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args(Qnone, $1, $3, $5, $6); } | f_block_optarg opt_block_args_tail { $$ = new_args(Qnone, $1, Qnone, Qnone, $2); } | f_block_optarg ',' f_arg opt_block_args_tail { $$ = new_args(Qnone, $1, Qnone, $3, $4); } | f_rest_arg opt_block_args_tail { $$ = new_args(Qnone, Qnone, $1, Qnone, $2); } | f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args(Qnone, Qnone, $1, $3, $4); } | block_args_tail { $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1); } ;opt_block_param : none | block_param_def { command_start = TRUE; } ;block_param_def : '|' opt_bv_decl '|' { $$ = 0; } | tOROP { $$ = 0; } | '|' block_param opt_bv_decl '|' { $$ = $2; } ;opt_bv_decl : opt_nl { $$ = 0; } | opt_nl ';' bv_decls opt_nl { $$ = 0; } ;bv_decls : bvar | bv_decls ',' bvar ;bvar : tIDENTIFIER { new_bv(get_id($1)); } | f_bad_arg { $$ = 0; } ;lambda : { $<vars>$ = dyna_push(); } { $<num>$ = lpar_beg; lpar_beg = ++paren_nest; } f_larglist lambda_body { lpar_beg = $<num>2; $$ = NEW_LAMBDA($3, $4); dyna_pop($<vars>1); } ;f_larglist : '(' f_args opt_bv_decl ')' { $$ = $2; } | f_args { $$ = $1; } ;lambda_body : tLAMBEG compstmt '}' { $$ = $2; } | keyword_do_LAMBDA compstmt keyword_end { $$ = $2; } ;do_block : keyword_do_block { $<vars>1 = dyna_push(); $<num>$ = ruby_sourceline; } opt_block_param compstmt keyword_end { $$ = NEW_ITER($3,$4); nd_set_line($$, $<num>2); dyna_pop($<vars>1); } ;block_call : command do_block { if (nd_type($1) == NODE_YIELD) { compile_error(PARSER_ARG "block given to yield"); } else { block_dup_check($1->nd_args, $2); } $2->nd_iter = $1; $$ = $2; fixpos($$, $1); } | block_call dot_or_colon operation2 opt_paren_args { $$ = NEW_CALL($1, $3, $4); } | block_call dot_or_colon operation2 opt_paren_args brace_block { block_dup_check($4, $5); $5->nd_iter = NEW_CALL($1, $3, $4); $$ = $5; fixpos($$, $1); } | block_call dot_or_colon operation2 command_args do_block { block_dup_check($4, $5); $5->nd_iter = NEW_CALL($1, $3, $4); $$ = $5; fixpos($$, $1); } ;method_call : fcall paren_args { $$ = $1; $$->nd_args = $2; } | primary_value '.' operation2 { $<num>$ = ruby_sourceline; } opt_paren_args { $$ = NEW_CALL($1, $3, $5); nd_set_line($$, $<num>4); } | primary_value tCOLON2 operation2 { $<num>$ = ruby_sourceline; } paren_args { $$ = NEW_CALL($1, $3, $5); nd_set_line($$, $<num>4); } | primary_value tCOLON2 operation3 { $$ = NEW_CALL($1, $3, 0); } | primary_value '.' { $<num>$ = ruby_sourceline; } paren_args { $$ = NEW_CALL($1, rb_intern("call"), $4); nd_set_line($$, $<num>3); } | primary_value tCOLON2 { $<num>$ = ruby_sourceline; } paren_args { $$ = NEW_CALL($1, rb_intern("call"), $4); nd_set_line($$, $<num>3); } | keyword_super paren_args { $$ = NEW_SUPER($2); } | keyword_super { $$ = NEW_ZSUPER(); } | primary_value '[' opt_call_args rbracket { if ($1 && nd_type($1) == NODE_SELF) $$ = NEW_FCALL(tAREF, $3); else $$ = NEW_CALL($1, tAREF, $3); fixpos($$, $1); } ;brace_block : '{' { $<vars>1 = dyna_push(); $<num>$ = ruby_sourceline; } opt_block_param compstmt '}' { $$ = NEW_ITER($3,$4); nd_set_line($$, $<num>2); dyna_pop($<vars>1); } | keyword_do { $<vars>1 = dyna_push(); $<num>$ = ruby_sourceline; } opt_block_param compstmt keyword_end { $$ = NEW_ITER($3,$4); nd_set_line($$, $<num>2); dyna_pop($<vars>1); } ;case_body : keyword_when args then compstmt cases { $$ = NEW_WHEN($2, $4, $5); } ;cases : opt_else | case_body ;opt_rescue : keyword_rescue exc_list exc_var then compstmt opt_rescue { if ($3) { $3 = node_assign($3, NEW_ERRINFO()); $5 = block_append($3, $5); } $$ = NEW_RESBODY($2, $5, $6); fixpos($$, $2?$2:$5); } | none ;exc_list : arg_value { $$ = NEW_LIST($1); } | mrhs { if (!($$ = splat_array($1))) $$ = $1; } | none ;exc_var : tASSOC lhs { $$ = $2; } | none ;opt_ensure : keyword_ensure compstmt { $$ = $2; } | none ;literal : numeric | symbol { $$ = NEW_LIT(ID2SYM($1)); } | dsym ;strings : string { NODE *node = $1; if (!node) { node = NEW_STR(STR_NEW0()); } else { node = evstr2dstr(node); } $$ = node; } ;string : tCHAR | string1 | string string1 { $$ = literal_concat($1, $2); } ;string1 : tSTRING_BEG string_contents tSTRING_END { $$ = $2; } ;xstring : tXSTRING_BEG xstring_contents tSTRING_END { NODE *node = $2; if (!node) { node = NEW_XSTR(STR_NEW0()); } else { switch (nd_type(node)) { case NODE_STR: nd_set_type(node, NODE_XSTR); break; case NODE_DSTR: nd_set_type(node, NODE_DXSTR); break; default: node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node)); break; } } $$ = node; } ;regexp : tREGEXP_BEG regexp_contents tREGEXP_END { int options = $3; NODE *node = $2; NODE *list, *prev; if (!node) { node = NEW_LIT(reg_compile(STR_NEW0(), options)); } else switch (nd_type(node)) { case NODE_STR: { VALUE src = node->nd_lit; nd_set_type(node, NODE_LIT); node->nd_lit = reg_compile(src, options); } break; default: node = NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node)); case NODE_DSTR: if (options & RE_OPTION_ONCE) { nd_set_type(node, NODE_DREGX_ONCE); } else { nd_set_type(node, NODE_DREGX); } node->nd_cflag = options & RE_OPTION_MASK; if (!NIL_P(node->nd_lit)) reg_fragment_check(node->nd_lit, options); for (list = (prev = node)->nd_next; list; list = list->nd_next) { if (nd_type(list->nd_head) == NODE_STR) { VALUE tail = list->nd_head->nd_lit; if (reg_fragment_check(tail, options) && prev && !NIL_P(prev->nd_lit)) { VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit; if (!literal_concat0(parser, lit, tail)) { node = 0; break; } rb_str_resize(tail, 0); prev->nd_next = list->nd_next; rb_gc_force_recycle((VALUE)list->nd_head); rb_gc_force_recycle((VALUE)list); list = prev; } else { prev = list; } } else { prev = 0; } } if (!node->nd_next) { VALUE src = node->nd_lit; nd_set_type(node, NODE_LIT); node->nd_lit = reg_compile(src, options); } break; } $$ = node; } ;words : tWORDS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tWORDS_BEG word_list tSTRING_END { $$ = $2; } ;word_list : { $$ = 0; } | word_list word ' ' { $$ = list_append($1, evstr2dstr($2)); } ;word : string_content | word string_content { $$ = literal_concat($1, $2); } ;symbols : tSYMBOLS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tSYMBOLS_BEG symbol_list tSTRING_END { $$ = $2; } ;symbol_list : { $$ = 0; } | symbol_list word ' ' { $2 = evstr2dstr($2); nd_set_type($2, NODE_DSYM); $$ = list_append($1, $2); } ;qwords : tQWORDS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tQWORDS_BEG qword_list tSTRING_END { $$ = $2; } ;qsymbols : tQSYMBOLS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tQSYMBOLS_BEG qsym_list tSTRING_END { $$ = $2; } ;qword_list : { $$ = 0; } | qword_list tSTRING_CONTENT ' ' { $$ = list_append($1, $2); } ;qsym_list : { $$ = 0; } | qsym_list tSTRING_CONTENT ' ' { VALUE lit; lit = $2->nd_lit; $2->nd_lit = ID2SYM(rb_intern_str(lit)); nd_set_type($2, NODE_LIT); $$ = list_append($1, $2); } ;string_contents : { $$ = 0; } | string_contents string_content { $$ = literal_concat($1, $2); } ;xstring_contents: { $$ = 0; } | xstring_contents string_content { $$ = literal_concat($1, $2); } ;regexp_contents: { $$ = 0; } | regexp_contents string_content { NODE *head = $1, *tail = $2; if (!head) { $$ = tail; } else if (!tail) { $$ = head; } else { switch (nd_type(head)) { case NODE_STR: nd_set_type(head, NODE_DSTR); break; case NODE_DSTR: break; default: head = list_append(NEW_DSTR(Qnil), head); break; } $$ = list_append(head, tail); } } ;string_content : tSTRING_CONTENT | tSTRING_DVAR { $<node>$ = lex_strterm; lex_strterm = 0; lex_state = EXPR_BEG; } string_dvar { lex_strterm = $<node>2; $$ = NEW_EVSTR($3); } | tSTRING_DBEG { $<val>1 = cond_stack; $<val>$ = cmdarg_stack; cond_stack = 0; cmdarg_stack = 0; } { $<node>$ = lex_strterm; lex_strterm = 0; lex_state = EXPR_BEG; } { $<num>$ = brace_nest; brace_nest = 0; } compstmt tSTRING_DEND { cond_stack = $<val>1; cmdarg_stack = $<val>2; lex_strterm = $<node>3; brace_nest = $<num>4; if ($5) $5->flags &= ~NODE_FL_NEWLINE; $$ = new_evstr($5); } ;string_dvar : tGVAR { $$ = NEW_GVAR($1); } | tIVAR { $$ = NEW_IVAR($1); } | tCVAR { $$ = NEW_CVAR($1); } | backref ;symbol : tSYMBEG sym { lex_state = EXPR_END; $$ = $2; } ;sym : fname | tIVAR | tGVAR | tCVAR ;dsym : tSYMBEG xstring_contents tSTRING_END { lex_state = EXPR_END; $$ = dsym_node($2); } ;numeric : tINTEGER | tFLOAT | tUMINUS_NUM tINTEGER %prec tLOWEST { $$ = negate_lit($2); } | tUMINUS_NUM tFLOAT %prec tLOWEST { $$ = negate_lit($2); } ;user_variable : tIDENTIFIER | tIVAR | tGVAR | tCONSTANT | tCVAR ;keyword_variable: keyword_nil {ifndef_ripper($$ = keyword_nil);} | keyword_self {ifndef_ripper($$ = keyword_self);} | keyword_true {ifndef_ripper($$ = keyword_true);} | keyword_false {ifndef_ripper($$ = keyword_false);} | keyword__FILE__ {ifndef_ripper($$ = keyword__FILE__);} | keyword__LINE__ {ifndef_ripper($$ = keyword__LINE__);} | keyword__ENCODING__ {ifndef_ripper($$ = keyword__ENCODING__);} ;var_ref : user_variable { if (!($$ = gettable($1))) $$ = NEW_BEGIN(0); } | keyword_variable { if (!($$ = gettable($1))) $$ = NEW_BEGIN(0); } ;var_lhs : user_variable { $$ = assignable($1, 0); } | keyword_variable { $$ = assignable($1, 0); } ;backref : tNTH_REF | tBACK_REF ;superclass : term { $$ = 0; } | '<' { lex_state = EXPR_BEG; command_start = TRUE; } expr_value term { $$ = $3; } | error term { yyerrok; $$ = 0; } ;f_arglist : '(' f_args rparen { $$ = $2; lex_state = EXPR_BEG; command_start = TRUE; } | f_args term { $$ = $1; lex_state = EXPR_BEG; command_start = TRUE; } ;args_tail : f_kwarg ',' f_kwrest opt_f_block_arg { $$ = new_args_tail($1, $3, $4); } | f_kwarg opt_f_block_arg { $$ = new_args_tail($1, Qnone, $2); } | f_kwrest opt_f_block_arg { $$ = new_args_tail(Qnone, $1, $2); } | f_block_arg { $$ = new_args_tail(Qnone, Qnone, $1); } ;opt_args_tail : ',' args_tail { $$ = $2; } | { $$ = new_args_tail(Qnone, Qnone, Qnone); } ;f_args : f_arg ',' f_optarg ',' f_rest_arg opt_args_tail { $$ = new_args($1, $3, $5, Qnone, $6); } | f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail { $$ = new_args($1, $3, $5, $7, $8); } | f_arg ',' f_optarg opt_args_tail { $$ = new_args($1, $3, Qnone, Qnone, $4); } | f_arg ',' f_optarg ',' f_arg opt_args_tail { $$ = new_args($1, $3, Qnone, $5, $6); } | f_arg ',' f_rest_arg opt_args_tail { $$ = new_args($1, Qnone, $3, Qnone, $4); } | f_arg ',' f_rest_arg ',' f_arg opt_args_tail { $$ = new_args($1, Qnone, $3, $5, $6); } | f_arg opt_args_tail { $$ = new_args($1, Qnone, Qnone, Qnone, $2); } | f_optarg ',' f_rest_arg opt_args_tail { $$ = new_args(Qnone, $1, $3, Qnone, $4); } | f_optarg ',' f_rest_arg ',' f_arg opt_args_tail { $$ = new_args(Qnone, $1, $3, $5, $6); } | f_optarg opt_args_tail { $$ = new_args(Qnone, $1, Qnone, Qnone, $2); } | f_optarg ',' f_arg opt_args_tail { $$ = new_args(Qnone, $1, Qnone, $3, $4); } | f_rest_arg opt_args_tail { $$ = new_args(Qnone, Qnone, $1, Qnone, $2); } | f_rest_arg ',' f_arg opt_args_tail { $$ = new_args(Qnone, Qnone, $1, $3, $4); } | args_tail { $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1); } | { $$ = new_args_tail(Qnone, Qnone, Qnone); $$ = new_args(Qnone, Qnone, Qnone, Qnone, $$); } ;f_bad_arg : tCONSTANT { yyerror("formal argument cannot be a constant"); $$ = 0; } | tIVAR { yyerror("formal argument cannot be an instance variable"); $$ = 0; } | tGVAR { yyerror("formal argument cannot be a global variable"); $$ = 0; } | tCVAR { yyerror("formal argument cannot be a class variable"); $$ = 0; } ;f_norm_arg : f_bad_arg | tIDENTIFIER { formal_argument(get_id($1)); $$ = $1; } ;f_arg_item : f_norm_arg { arg_var(get_id($1)); $$ = NEW_ARGS_AUX($1, 1); } | tLPAREN f_margs rparen { ID tid = internal_id(); arg_var(tid); if (dyna_in_block()) { $2->nd_value = NEW_DVAR(tid); } else { $2->nd_value = NEW_LVAR(tid); } $$ = NEW_ARGS_AUX(tid, 1); $$->nd_next = $2; } ;f_arg : f_arg_item | f_arg ',' f_arg_item { $$ = $1; $$->nd_plen++; $$->nd_next = block_append($$->nd_next, $3->nd_next); rb_gc_force_recycle((VALUE)$3); } ;f_kw : tLABEL arg_value { arg_var(formal_argument(get_id($1))); $$ = assignable($1, $2); $$ = NEW_KW_ARG(0, $$); } ;f_block_kw : tLABEL primary_value { arg_var(formal_argument(get_id($1))); $$ = assignable($1, $2); $$ = NEW_KW_ARG(0, $$); } ;f_block_kwarg : f_block_kw { $$ = $1; } | f_block_kwarg ',' f_block_kw { NODE *kws = $1; while (kws->nd_next) { kws = kws->nd_next; } kws->nd_next = $3; $$ = $1; } ;f_kwarg : f_kw { $$ = $1; } | f_kwarg ',' f_kw { NODE *kws = $1; while (kws->nd_next) { kws = kws->nd_next; } kws->nd_next = $3; $$ = $1; } ;kwrest_mark : tPOW | tDSTAR ;f_kwrest : kwrest_mark tIDENTIFIER { shadowing_lvar(get_id($2)); $$ = $2; } | kwrest_mark { $$ = internal_id(); } ;f_opt : tIDENTIFIER '=' arg_value { arg_var(formal_argument(get_id($1))); $$ = assignable($1, $3); $$ = NEW_OPT_ARG(0, $$); } ;f_block_opt : tIDENTIFIER '=' primary_value { arg_var(formal_argument(get_id($1))); $$ = assignable($1, $3); $$ = NEW_OPT_ARG(0, $$); } ;f_block_optarg : f_block_opt { $$ = $1; } | f_block_optarg ',' f_block_opt { NODE *opts = $1; while (opts->nd_next) { opts = opts->nd_next; } opts->nd_next = $3; $$ = $1; } ;f_optarg : f_opt { $$ = $1; } | f_optarg ',' f_opt { NODE *opts = $1; while (opts->nd_next) { opts = opts->nd_next; } opts->nd_next = $3; $$ = $1; } ;restarg_mark : '*' | tSTAR ;f_rest_arg : restarg_mark tIDENTIFIER { if (!is_local_id($2)) yyerror("rest argument must be local variable"); arg_var(shadowing_lvar(get_id($2))); $$ = $2; } | restarg_mark { $$ = internal_id(); arg_var($$); } ;blkarg_mark : '&' | tAMPER ;f_block_arg : blkarg_mark tIDENTIFIER { if (!is_local_id($2)) yyerror("block argument must be local variable"); else if (!dyna_in_block() && local_id($2)) yyerror("duplicated block argument name"); arg_var(shadowing_lvar(get_id($2))); $$ = $2; } ;opt_f_block_arg : ',' f_block_arg { $$ = $2; } | none { $$ = 0; } ;singleton : var_ref { value_expr($1); $$ = $1; if (!$$) $$ = NEW_NIL(); } | '(' {lex_state = EXPR_BEG;} expr rparen { if ($3 == 0) { yyerror("can't define singleton method for ()."); } else { switch (nd_type($3)) { case NODE_STR: case NODE_DSTR: case NODE_XSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_LIT: case NODE_ARRAY: case NODE_ZARRAY: yyerror("can't define singleton method for literals"); default: value_expr($3); break; } } $$ = $3; } ;assoc_list : none | assocs trailer { $$ = $1; } ;assocs : assoc | assocs ',' assoc { $$ = list_concat($1, $3); } ;assoc : arg_value tASSOC arg_value { $$ = list_append(NEW_LIST($1), $3); } | tLABEL arg_value { $$ = list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2); } | tDSTAR arg_value { $$ = list_append(NEW_LIST(0), $2); } ; ;operation : tIDENTIFIER | tCONSTANT | tFID ;operation2 : tIDENTIFIER | tCONSTANT | tFID | op ;operation3 : tIDENTIFIER | tFID | op ;dot_or_colon : '.' | tCOLON2 ;opt_terms : | terms ;opt_nl : | '\n' ;rparen : opt_nl ')' ;rbracket : opt_nl ']' ;trailer : | '\n' | ',' ;term : ';' {yyerrok;} | '\n' ;terms : term | terms ';' {yyerrok;} ;none : { $$ = 0; } ;%%#define yylvalstatic int parser_regx_options(struct parser_params*);static int parser_tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**);static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);static int parser_parse_string(struct parser_params*,NODE*);static int parser_here_document(struct parser_params*,NODE*);#define nextc() #define pushback(c) #define newtok() #define tokspace(n) #define tokadd(c) #define tok_hex(numlen) #define read_escape(flags,e) #define tokadd_escape(e) #define regx_options() #define tokadd_string(f,t,p,n,e) #define parse_string(n) #define tokaddmbc(c, enc) #define here_document(n) #define heredoc_identifier() #define heredoc_restore(n) #define whole_match_p(e,l,i) #define set_yylval_str(x) #define set_yylval_num(x) #define set_yylval_id(x) #define set_yylval_name(x) #define set_yylval_literal(x) #define set_yylval_node(x) #define yylval_id() #define ripper_flush(p) #define SIGN_EXTEND_CHAR(c) #define parser_encoding_name() #define parser_mbclen() #define parser_precise_mbclen() #define is_identchar(p,e,enc) #define parser_is_identchar() #define parser_isascii() static inttoken_info_get_column(struct parser_params *parser, const char *token){ int column = 1; const char *p, *pend = lex_p - strlen(token); for (p = lex_pbeg; p < pend; p++) { if (*p == '\t') { column = (((column - 1) / 8) + 1) * 8; } column++; } return column;}static inttoken_info_has_nonspaces(struct parser_params *parser, const char *token){ const char *p, *pend = lex_p - strlen(token); for (p = lex_pbeg; p < pend; p++) { if (*p != ' ' && *p != '\t') { return 1; } } return 0;}static voidtoken_info_push(struct parser_params *parser, const char *token){ token_info *ptinfo; if (!parser->parser_token_info_enabled) return; ptinfo = ALLOC(token_info); ptinfo->token = token; ptinfo->linenum = ruby_sourceline; ptinfo->column = token_info_get_column(parser, token); ptinfo->nonspc = token_info_has_nonspaces(parser, token); ptinfo->next = parser->parser_token_info; parser->parser_token_info = ptinfo;}static voidtoken_info_pop(struct parser_params *parser, const char *token){ int linenum; token_info *ptinfo = parser->parser_token_info; if (!ptinfo) return; parser->parser_token_info = ptinfo->next; if (token_info_get_column(parser, token) == ptinfo->column) { goto finish; } linenum = ruby_sourceline; if (linenum == ptinfo->linenum) { goto finish; } if (token_info_has_nonspaces(parser, token) || ptinfo->nonspc) { goto finish; } if (parser->parser_token_info_enabled) { rb_compile_warn(ruby_sourcefile, linenum, "mismatched indentations at '%s' with '%s' at %d", token, ptinfo->token, ptinfo->linenum); } finish: xfree(ptinfo);}static intparser_yyerror(struct parser_params *parser, const char *msg){ const int max_line_margin = 30; const char *p, *pe; char *buf; long len; int i; compile_error(PARSER_ARG "%s", msg); p = lex_p; while (lex_pbeg <= p) { if (*p == '\n') break; p--; } p++; pe = lex_p; while (pe < lex_pend) { if (*pe == '\n') break; pe++; } len = pe - p; if (len > 4) { char *p2; const char *pre = "", *post = ""; if (len > max_line_margin * 2 + 10) { if (lex_p - p > max_line_margin) { p = rb_enc_prev_char(p, lex_p - max_line_margin, pe, rb_enc_get(lex_lastline)); pre = "..."; } if (pe - lex_p > max_line_margin) { pe = rb_enc_prev_char(lex_p, lex_p + max_line_margin, pe, rb_enc_get(lex_lastline)); post = "..."; } len = pe - p; } buf = ALLOCA_N(char, len+2); MEMCPY(buf, p, char, len); buf[len] = '\0'; rb_compile_error_append("%s%s%s", pre, buf, post); i = (int)(lex_p - p); p2 = buf; pe = buf + len; while (p2 < pe) { if (*p2 != '\t') *p2 = ' '; p2++; } buf[i] = '^'; buf[i+1] = '\0'; rb_compile_error_append("%s%s", pre, buf); } return 0;}static void parser_prepare(struct parser_params *parser);static VALUEdebug_lines(const char *f){ ID script_lines; CONST_ID(script_lines, "SCRIPT_LINES__"); if (rb_const_defined_at(rb_cObject, script_lines)) { VALUE hash = rb_const_get_at(rb_cObject, script_lines); if (RB_TYPE_P(hash, T_HASH)) { VALUE fname = rb_external_str_new_with_enc(f, strlen(f), rb_filesystem_encoding()); VALUE lines = rb_ary_new(); rb_hash_aset(hash, fname, lines); return lines; } } return 0;}static VALUEcoverage(const char *f, int n){ VALUE coverages = rb_get_coverages(); if (RTEST(coverages) && RBASIC(coverages)->klass == 0) { VALUE fname = rb_external_str_new_with_enc(f, strlen(f), rb_filesystem_encoding()); VALUE lines = rb_ary_new2(n); int i; RBASIC(lines)->klass = 0; for (i = 0; i < n; i++) RARRAY_PTR(lines)[i] = Qnil; RARRAY(lines)->as.heap.len = n; rb_hash_aset(coverages, fname, lines); return lines; } return 0;}static inte_option_supplied(struct parser_params *parser){ return strcmp(ruby_sourcefile, "-e") == 0;}static VALUEyycompile0(VALUE arg){ int n; NODE *tree; struct parser_params *parser = (struct parser_params *)arg; if (!compile_for_eval && rb_safe_level() == 0) { ruby_debug_lines = debug_lines(ruby_sourcefile); if (ruby_debug_lines && ruby_sourceline > 0) { VALUE str = STR_NEW0(); n = ruby_sourceline; do { rb_ary_push(ruby_debug_lines, str); } while (--n); } if (!e_option_supplied(parser)) { ruby_coverage = coverage(ruby_sourcefile, ruby_sourceline); } } parser_prepare(parser); deferred_nodes = 0; parser->parser_token_info_enabled = !compile_for_eval && RTEST(ruby_verbose); if (RUBY_DTRACE_PARSE_BEGIN_ENABLED()) { RUBY_DTRACE_PARSE_BEGIN(parser->parser_ruby_sourcefile, parser->parser_ruby_sourceline); } n = yyparse((void*)parser); if (RUBY_DTRACE_PARSE_END_ENABLED()) { RUBY_DTRACE_PARSE_END(parser->parser_ruby_sourcefile, parser->parser_ruby_sourceline); } ruby_debug_lines = 0; ruby_coverage = 0; compile_for_eval = 0; lex_strterm = 0; lex_p = lex_pbeg = lex_pend = 0; lex_lastline = lex_nextline = 0; if (parser->nerr) { return 0; } tree = ruby_eval_tree; if (!tree) { tree = NEW_NIL(); } else if (ruby_eval_tree_begin) { tree->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body); } return (VALUE)tree;}static NODE*yycompile(struct parser_params *parser, const char *f, int line){ ruby_sourcefile = ruby_strdup(f); ruby_sourceline = line - 1; return (NODE *)rb_suppress_tracing(yycompile0, (VALUE)parser);}static rb_encoding *must_be_ascii_compatible(VALUE s){ rb_encoding *enc = rb_enc_get(s); if (!rb_enc_asciicompat(enc)) { rb_raise(rb_eArgError, "invalid source encoding"); } return enc;}static VALUElex_get_str(struct parser_params *parser, VALUE s){ char *beg, *end, *pend; rb_encoding *enc = must_be_ascii_compatible(s); beg = RSTRING_PTR(s); if (lex_gets_ptr) { if (RSTRING_LEN(s) == lex_gets_ptr) return Qnil; beg += lex_gets_ptr; } pend = RSTRING_PTR(s) + RSTRING_LEN(s); end = beg; while (end < pend) { if (*end++ == '\n') break; } lex_gets_ptr = end - RSTRING_PTR(s); return rb_enc_str_new(beg, end - beg, enc);}static VALUElex_getline(struct parser_params *parser){ VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input); if (NIL_P(line)) return line; must_be_ascii_compatible(line); if (ruby_debug_lines) { rb_enc_associate(line, current_enc); rb_ary_push(ruby_debug_lines, line); } if (ruby_coverage) { rb_ary_push(ruby_coverage, Qnil); } return line;}static const rb_data_type_t parser_data_type;static NODE*parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line){ struct parser_params *parser; NODE *node; TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser); lex_gets = lex_get_str; lex_gets_ptr = 0; lex_input = s; lex_pbeg = lex_p = lex_pend = 0; compile_for_eval = rb_parse_in_eval(); node = yycompile(parser, f, line); RB_GC_GUARD(vparser); return node;}NODE*rb_compile_string(const char *f, VALUE s, int line){ must_be_ascii_compatible(s); return parser_compile_string(rb_parser_new(), f, s, line);}NODE*rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line){ must_be_ascii_compatible(s); return parser_compile_string(vparser, f, s, line);}NODE*rb_compile_cstr(const char *f, const char *s, int len, int line){ VALUE str = rb_str_new(s, len); return parser_compile_string(rb_parser_new(), f, str, line);}NODE*rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line){ VALUE str = rb_str_new(s, len); return parser_compile_string(vparser, f, str, line);}static VALUElex_io_gets(struct parser_params *parser, VALUE io){ return rb_io_gets(io);}NODE*rb_compile_file(const char *f, VALUE file, int start){ VALUE volatile vparser = rb_parser_new(); return rb_parser_compile_file(vparser, f, file, start);}NODE*rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start){ struct parser_params *parser; NODE *node; TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser); lex_gets = lex_io_gets; lex_input = file; lex_pbeg = lex_p = lex_pend = 0; compile_for_eval = rb_parse_in_eval(); node = yycompile(parser, f, start); RB_GC_GUARD(vparser); return node;}#define STR_FUNC_ESCAPE#define STR_FUNC_EXPAND#define STR_FUNC_REGEXP#define STR_FUNC_QWORDS#define STR_FUNC_SYMBOL#define STR_FUNC_INDENTenum string_type { str_squote = (0), str_dquote = (STR_FUNC_EXPAND), str_xquote = (STR_FUNC_EXPAND), str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword = (STR_FUNC_QWORDS), str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND), str_ssym = (STR_FUNC_SYMBOL), str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)};static VALUEparser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0){ VALUE str; str = rb_enc_str_new(p, n, enc); if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) { if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) { } else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) { rb_enc_associate(str, rb_ascii8bit_encoding()); } } return str;}#define lex_goto_eol(parser) #define lex_eol_p() #define peek(c) #define peek_n(c,n) static inline intparser_nextc(struct parser_params *parser){ int c; if (lex_p == lex_pend) { VALUE v = lex_nextline; lex_nextline = 0; if (!v) { if (parser->eofp) return -1; if (!lex_input || NIL_P(v = lex_getline(parser))) { parser->eofp = Qtrue; lex_goto_eol(parser); return -1; } } { if (heredoc_end > 0) { ruby_sourceline = heredoc_end; heredoc_end = 0; } ruby_sourceline++; parser->line_count++; lex_pbeg = lex_p = RSTRING_PTR(v); lex_pend = lex_p + RSTRING_LEN(v); ripper_flush(parser); lex_lastline = v; } } c = (unsigned char)*lex_p++; if (c == '\r' && peek('\n')) { lex_p++; c = '\n'; } return c;}static voidparser_pushback(struct parser_params *parser, int c){ if (c == -1) return; lex_p--; if (lex_p > lex_pbeg && lex_p[0] == '\n' && lex_p[-1] == '\r') { lex_p--; }}#define was_bol() #define tokfix() #define tok() #define toklen() #define toklast() static char*parser_newtok(struct parser_params *parser){ tokidx = 0; tokline = ruby_sourceline; if (!tokenbuf) { toksiz = 60; tokenbuf = ALLOC_N(char, 60); } if (toksiz > 4096) { toksiz = 60; REALLOC_N(tokenbuf, char, 60); } return tokenbuf;}static char *parser_tokspace(struct parser_params *parser, int n){ tokidx += n; if (tokidx >= toksiz) { do {toksiz *= 2;} while (toksiz < tokidx); REALLOC_N(tokenbuf, char, toksiz); } return &tokenbuf[tokidx-n];}static voidparser_tokadd(struct parser_params *parser, int c){ tokenbuf[tokidx++] = (char)c; if (tokidx >= toksiz) { toksiz *= 2; REALLOC_N(tokenbuf, char, toksiz); }}static intparser_tok_hex(struct parser_params *parser, size_t *numlen){ int c; c = scan_hex(lex_p, 2, numlen); if (!*numlen) { yyerror("invalid hex escape"); return 0; } lex_p += *numlen; return c;}#define tokcopy(n) static intparser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, int string_literal, int symbol_literal, int regexp_literal){ int codepoint; size_t numlen; if (regexp_literal) { tokadd('\\'); tokadd('u'); } if (peek('{')) { do { if (regexp_literal) { tokadd(*lex_p); } nextc(); codepoint = scan_hex(lex_p, 6, &numlen); if (numlen == 0) { yyerror("invalid Unicode escape"); return 0; } if (codepoint > 0x10ffff) { yyerror("invalid Unicode codepoint (too large)"); return 0; } lex_p += numlen; if (regexp_literal) { tokcopy((int)numlen); } else if (codepoint >= 0x80) { *encp = rb_utf8_encoding(); if (string_literal) tokaddmbc(codepoint, *encp); } else if (string_literal) { tokadd(codepoint); } } while (string_literal && (peek(' ') || peek('\t'))); if (!peek('}')) { yyerror("unterminated Unicode escape"); return 0; } if (regexp_literal) { tokadd('}'); } nextc(); } else { codepoint = scan_hex(lex_p, 4, &numlen); if (numlen < 4) { yyerror("invalid Unicode escape"); return 0; } lex_p += 4; if (regexp_literal) { tokcopy(4); } else if (codepoint >= 0x80) { *encp = rb_utf8_encoding(); if (string_literal) tokaddmbc(codepoint, *encp); } else if (string_literal) { tokadd(codepoint); } } return codepoint;}#define ESCAPE_CONTROL#define ESCAPE_METAstatic intparser_read_escape(struct parser_params *parser, int flags, rb_encoding **encp){ int c; size_t numlen; switch (c = nextc()) { case '\\': return c; case 'n': return '\n'; case 't': return '\t'; case 'r': return '\r'; case 'f': return '\f'; case 'v': return '\13'; case 'a': return '\007'; case 'e': return 033; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': pushback(c); c = scan_oct(lex_p, 3, &numlen); lex_p += numlen; return c; case 'x': c = tok_hex(&numlen); if (numlen == 0) return 0; return c; case 'b': return '\010'; case 's': return ' '; case 'M': if (flags & ESCAPE_META) goto eof; if ((c = nextc()) != '-') { pushback(c); goto eof; } if ((c = nextc()) == '\\') { if (peek('u')) goto eof; return read_escape(flags|ESCAPE_META, encp) | 0x80; } else if (c == -1 || !ISASCII(c)) goto eof; else { return ((c & 0xff) | 0x80); } case 'C': if ((c = nextc()) != '-') { pushback(c); goto eof; } case 'c': if (flags & ESCAPE_CONTROL) goto eof; if ((c = nextc())== '\\') { if (peek('u')) goto eof; c = read_escape(flags|ESCAPE_CONTROL, encp); } else if (c == '?') return 0177; else if (c == -1 || !ISASCII(c)) goto eof; return c & 0x9f; eof: case -1: yyerror("Invalid escape character syntax"); return '\0'; default: return c; }}static voidparser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc){ int len = rb_enc_codelen(c, enc); rb_enc_mbcput(c, tokspace(len), enc);}static intparser_tokadd_escape(struct parser_params *parser, rb_encoding **encp){ int c; int flags = 0; size_t numlen; first: switch (c = nextc()) { case '\n': return 0; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { ruby_scan_oct(--lex_p, 3, &numlen); if (numlen == 0) goto eof; lex_p += numlen; tokcopy((int)numlen + 1); } return 0; case 'x': { tok_hex(&numlen); if (numlen == 0) return -1; tokcopy((int)numlen + 2); } return 0; case 'M': if (flags & ESCAPE_META) goto eof; if ((c = nextc()) != '-') { pushback(c); goto eof; } tokcopy(3); flags |= ESCAPE_META; goto escaped; case 'C': if (flags & ESCAPE_CONTROL) goto eof; if ((c = nextc()) != '-') { pushback(c); goto eof; } tokcopy(3); goto escaped; case 'c': if (flags & ESCAPE_CONTROL) goto eof; tokcopy(2); flags |= ESCAPE_CONTROL; escaped: if ((c = nextc()) == '\\') { goto first; } else if (c == -1) goto eof; tokadd(c); return 0; eof: case -1: yyerror("Invalid escape character syntax"); return -1; default: tokadd('\\'); tokadd(c); } return 0;}static intparser_regx_options(struct parser_params *parser){ int kcode = 0; int kopt = 0; int options = 0; int c, opt, kc; newtok(); while (c = nextc(), ISALPHA(c)) { if (c == 'o') { options |= RE_OPTION_ONCE; } else if (rb_char_to_option_kcode(c, &opt, &kc)) { if (kc >= 0) { if (kc != rb_ascii8bit_encindex()) kcode = c; kopt = opt; } else { options |= opt; } } else { tokadd(c); } } options |= kopt; pushback(c); if (toklen()) { tokfix(); compile_error(PARSER_ARG "unknown regexp option%s - %s", toklen() > 1 ? "s" : "", tok()); } return options | RE_OPTION_ENCODING(kcode);}static voiddispose_string(VALUE str){ rb_str_free(str); rb_gc_force_recycle(str);}static intparser_tokadd_mbchar(struct parser_params *parser, int c){ int len = parser_precise_mbclen(); if (!MBCLEN_CHARFOUND_P(len)) { compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name()); return -1; } tokadd(c); lex_p += --len; if (len > 0) tokcopy(len); return c;}#define tokadd_mbchar(c) static inline intsimple_re_meta(int c){ switch (c) { case '$': case '*': case '+': case '.': case '?': case '^': case '|': case ')': case ']': case '}': case '>': return TRUE; default: return FALSE; }}static intparser_tokadd_string(struct parser_params *parser, int func, int term, int paren, long *nest, rb_encoding **encp){ int c; int has_nonascii = 0; rb_encoding *enc = *encp; char *errbuf = 0; static const char mixed_msg[] = "%s mixed within %s source";#define mixed_error(enc1, enc2) #define mixed_escape(beg, enc1, enc2) while ((c = nextc()) != -1) { if (paren && c == paren) { ++*nest; } else if (c == term) { if (!nest || !*nest) { pushback(c); break; } --*nest; } else if ((func & STR_FUNC_EXPAND) && c == '#' && lex_p < lex_pend) { int c2 = *lex_p; if (c2 == '$' || c2 == '@' || c2 == '{') { pushback(c); break; } } else if (c == '\\') { const char *beg = lex_p - 1; c = nextc(); switch (c) { case '\n': if (func & STR_FUNC_QWORDS) break; if (func & STR_FUNC_EXPAND) continue; tokadd('\\'); break; case '\\': if (func & STR_FUNC_ESCAPE) tokadd(c); break; case 'u': if ((func & STR_FUNC_EXPAND) == 0) { tokadd('\\'); break; } parser_tokadd_utf8(parser, &enc, 1, func & STR_FUNC_SYMBOL, func & STR_FUNC_REGEXP); if (has_nonascii && enc != *encp) { mixed_escape(beg, enc, *encp); } continue; default: if (c == -1) return -1; if (!ISASCII(c)) { if ((func & STR_FUNC_EXPAND) == 0) tokadd('\\'); goto non_ascii; } if (func & STR_FUNC_REGEXP) { if (c == term && !simple_re_meta(c)) { tokadd(c); continue; } pushback(c); if ((c = tokadd_escape(&enc)) < 0) return -1; if (has_nonascii && enc != *encp) { mixed_escape(beg, enc, *encp); } continue; } else if (func & STR_FUNC_EXPAND) { pushback(c); if (func & STR_FUNC_ESCAPE) tokadd('\\'); c = read_escape(0, &enc); } else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { } else if (c != term && !(paren && c == paren)) { tokadd('\\'); pushback(c); continue; } } } else if (!parser_isascii()) { non_ascii: has_nonascii = 1; if (enc != *encp) { mixed_error(enc, *encp); continue; } if (tokadd_mbchar(c) == -1) return -1; continue; } else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { pushback(c); break; } if (c & 0x80) { has_nonascii = 1; if (enc != *encp) { mixed_error(enc, *encp); continue; } } tokadd(c); } *encp = enc; return c;}#define NEW_STRTERM(func, term, paren) #define flush_string_content(enc) RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];#define BIT(c, idx) #define SPECIAL_PUNCT(idx) const unsigned int ruby_global_name_punct_bits[] = { SPECIAL_PUNCT(0), SPECIAL_PUNCT(1), SPECIAL_PUNCT(2),};static inline intis_global_name_punct(const char c){ if (c <= 0x20 || 0x7e < c) return 0; return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1;}static intparser_peek_variable_name(struct parser_params *parser){ int c; const char *p = lex_p; if (p + 1 >= lex_pend) return 0; c = *p++; switch (c) { case '$': if ((c = *p) == '-') { if (++p >= lex_pend) return 0; c = *p; } else if (is_global_name_punct(c) || ISDIGIT(c)) { return tSTRING_DVAR; } break; case '@': if ((c = *p) == '@') { if (++p >= lex_pend) return 0; c = *p; } break; case '{': lex_p = p; command_start = TRUE; return tSTRING_DBEG; default: return 0; } if (!ISASCII(c) || c == '_' || ISALPHA(c)) return tSTRING_DVAR; return 0;}static intparser_parse_string(struct parser_params *parser, NODE *quote){ int func = (int)quote->nd_func; int term = nd_term(quote); int paren = nd_paren(quote); int c, space = 0; rb_encoding *enc = current_enc; if (func == -1) return tSTRING_END; c = nextc(); if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { do {c = nextc();} while (ISSPACE(c)); space = 1; } if (c == term && !quote->nd_nest) { if (func & STR_FUNC_QWORDS) { quote->nd_func = -1; return ' '; } if (!(func & STR_FUNC_REGEXP)) return tSTRING_END; set_yylval_num(regx_options()); return tREGEXP_END; } if (space) { pushback(c); return ' '; } newtok(); if ((func & STR_FUNC_EXPAND) && c == '#') { int t = parser_peek_variable_name(parser); if (t) return t; tokadd('#'); c = nextc(); } pushback(c); if (tokadd_string(func, term, paren, "e->nd_nest, &enc) == -1) { ruby_sourceline = nd_line(quote); if (func & STR_FUNC_REGEXP) { if (parser->eofp) compile_error(PARSER_ARG "unterminated regexp meets end of file"); return tREGEXP_END; } else { if (parser->eofp) compile_error(PARSER_ARG "unterminated string meets end of file"); return tSTRING_END; } } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, func)); flush_string_content(enc); return tSTRING_CONTENT;}static intparser_heredoc_identifier(struct parser_params *parser){ int c = nextc(), term, func = 0; long len; if (c == '-') { c = nextc(); func = STR_FUNC_INDENT; } switch (c) { case '\'': func |= str_squote; goto quoted; case '"': func |= str_dquote; goto quoted; case '`': func |= str_xquote; quoted: newtok(); tokadd(func); term = c; while ((c = nextc()) != -1 && c != term) { if (tokadd_mbchar(c) == -1) return 0; } if (c == -1) { compile_error(PARSER_ARG "unterminated here document identifier"); return 0; } break; default: if (!parser_is_identchar()) { pushback(c); if (func & STR_FUNC_INDENT) { pushback('-'); } return 0; } newtok(); term = '"'; tokadd(func |= str_dquote); do { if (tokadd_mbchar(c) == -1) return 0; } while ((c = nextc()) != -1 && parser_is_identchar()); pushback(c); break; } tokfix(); len = lex_p - lex_pbeg; lex_goto_eol(parser); lex_strterm = rb_node_newnode(NODE_HEREDOC, STR_NEW(tok(), toklen()), len, lex_lastline); nd_set_line(lex_strterm, ruby_sourceline); ripper_flush(parser); return term == '`' ? tXSTRING_BEG : tSTRING_BEG;}static voidparser_heredoc_restore(struct parser_params *parser, NODE *here){ VALUE line; line = here->nd_orig; lex_lastline = line; lex_pbeg = RSTRING_PTR(line); lex_pend = lex_pbeg + RSTRING_LEN(line); lex_p = lex_pbeg + here->nd_nth; heredoc_end = ruby_sourceline; ruby_sourceline = nd_line(here); dispose_string(here->nd_lit); rb_gc_force_recycle((VALUE)here); ripper_flush(parser);}static intparser_whole_match_p(struct parser_params *parser, const char *eos, long len, int indent){ const char *p = lex_pbeg; long n; if (indent) { while (*p && ISSPACE(*p)) p++; } n = lex_pend - (p + len); if (n < 0 || (n > 0 && p[len] != '\n' && p[len] != '\r')) return FALSE; return strncmp(eos, p, len) == 0;}#define dispatch_heredoc_end() static intparser_here_document(struct parser_params *parser, NODE *here){ int c, func, indent = 0; const char *eos, *p, *pend; long len; VALUE str = 0; rb_encoding *enc = current_enc; eos = RSTRING_PTR(here->nd_lit); len = RSTRING_LEN(here->nd_lit) - 1; indent = (func = *eos++) & STR_FUNC_INDENT; if ((c = nextc()) == -1) { error: compile_error(PARSER_ARG "can't find string \"%s\" anywhere before EOF", eos); restore: heredoc_restore(lex_strterm); lex_strterm = 0; return 0; } if (was_bol() && whole_match_p(eos, len, indent)) { dispatch_heredoc_end(); heredoc_restore(lex_strterm); return tSTRING_END; } if (!(func & STR_FUNC_EXPAND)) { do { p = RSTRING_PTR(lex_lastline); pend = lex_pend; if (pend > p) { switch (pend[-1]) { case '\n': if (--pend == p || pend[-1] != '\r') { pend++; break; } case '\r': --pend; } } if (str) rb_str_cat(str, p, pend - p); else str = STR_NEW(p, pend - p); if (pend < lex_pend) rb_str_cat(str, "\n", 1); lex_goto_eol(parser); if (nextc() == -1) { if (str) dispose_string(str); goto error; } } while (!whole_match_p(eos, len, indent)); } else { newtok(); if (c == '#') { int t = parser_peek_variable_name(parser); if (t) return t; tokadd('#'); c = nextc(); } do { pushback(c); if ((c = tokadd_string(func, '\n', 0, NULL, &enc)) == -1) { if (parser->eofp) goto error; goto restore; } if (c != '\n') { set_yylval_str(STR_NEW3(tok(), toklen(), enc, func)); flush_string_content(enc); return tSTRING_CONTENT; } tokadd(nextc()); if ((c = nextc()) == -1) goto error; } while (!whole_match_p(eos, len, indent)); str = STR_NEW3(tok(), toklen(), enc, func); } dispatch_heredoc_end(); heredoc_restore(lex_strterm); lex_strterm = NEW_STRTERM(-1, 0, 0); set_yylval_str(str); return tSTRING_CONTENT;}static voidarg_ambiguous_gen(struct parser_params *parser){ rb_warning0("ambiguous first argument; put parentheses or even spaces");}#define arg_ambiguous() static IDformal_argument_gen(struct parser_params *parser, ID lhs){ if (!is_local_id(lhs)) yyerror("formal argument must be local variable"); shadowing_lvar(lhs); return lhs;}static intlvar_defined_gen(struct parser_params *parser, ID id){ return (dyna_in_block() && dvar_defined_get(id)) || local_id(id);}static longparser_encode_length(struct parser_params *parser, const char *name, long len){ long nlen; if (len > 5 && name[nlen = len - 5] == '-') { if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0) return nlen; } if (len > 4 && name[nlen = len - 4] == '-') { if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0) return nlen; if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 && !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0)) return nlen; } return len;}static voidparser_set_encode(struct parser_params *parser, const char *name){ int idx = rb_enc_find_index(name); rb_encoding *enc; VALUE excargs[3]; if (idx < 0) { excargs[1] = rb_sprintf("unknown encoding name: %s", name); error: excargs[0] = rb_eArgError; excargs[2] = rb_make_backtrace(); rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline)); rb_exc_raise(rb_make_exception(3, excargs)); } enc = rb_enc_from_index(idx); if (!rb_enc_asciicompat(enc)) { excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc)); goto error; } parser->enc = enc; if (ruby_debug_lines) { long i, n = RARRAY_LEN(ruby_debug_lines); const VALUE *p = RARRAY_PTR(ruby_debug_lines); for (i = 0; i < n; ++i) { rb_enc_associate_index(*p, idx); } }}static intcomment_at_top(struct parser_params *parser){ const char *p = lex_pbeg, *pend = lex_p - 1; if (parser->line_count != (parser->has_shebang ? 2 : 1)) return 0; while (p < pend) { if (!ISSPACE(*p)) return 0; p++; } return 1;}typedef long (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);typedef void (*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);static voidmagic_comment_encoding(struct parser_params *parser, const char *name, const char *val){ if (!comment_at_top(parser)) { return; } parser_set_encode(parser, val);}static voidparser_set_token_info(struct parser_params *parser, const char *name, const char *val){ int *p = &parser->parser_token_info_enabled; switch (*val) { case 't': case 'T': if (strcasecmp(val, "true") == 0) { *p = TRUE; return; } break; case 'f': case 'F': if (strcasecmp(val, "false") == 0) { *p = FALSE; return; } break; } rb_compile_warning(ruby_sourcefile, ruby_sourceline, "invalid value for %s: %s", name, val);}struct magic_comment { const char *name; rb_magic_comment_setter_t func; rb_magic_comment_length_t length;};static const struct magic_comment magic_comments[] = { {"coding", magic_comment_encoding, parser_encode_length}, {"encoding", magic_comment_encoding, parser_encode_length}, {"warn_indent", parser_set_token_info},};static const char *magic_comment_marker(const char *str, long len){ long i = 2; while (i < len) { switch (str[i]) { case '-': if (str[i-1] == '*' && str[i-2] == '-') { return str + i + 1; } i += 2; break; case '*': if (i + 1 >= len) return 0; if (str[i+1] != '-') { i += 4; } else if (str[i-1] != '-') { i += 2; } else { return str + i + 2; } break; default: i += 3; break; } } return 0;}static intparser_magic_comment(struct parser_params *parser, const char *str, long len){ VALUE name = 0, val = 0; const char *beg, *end, *vbeg, *vend;#define str_copy(_s, _p, _n) if (len <= 7) return FALSE; if (!(beg = magic_comment_marker(str, len))) return FALSE; if (!(end = magic_comment_marker(beg, str + len - beg))) return FALSE; str = beg; len = end - beg - 3; while (len > 0) { const struct magic_comment *p = magic_comments; char *s; int i; long n = 0; for (; len > 0 && *str; str++, --len) { switch (*str) { case '\'': case '"': case ':': case ';': continue; } if (!ISSPACE(*str)) break; } for (beg = str; len > 0; str++, --len) { switch (*str) { case '\'': case '"': case ':': case ';': break; default: if (ISSPACE(*str)) break; continue; } break; } for (end = str; len > 0 && ISSPACE(*str); str++, --len); if (!len) break; if (*str != ':') continue; do str++; while (--len > 0 && ISSPACE(*str)); if (!len) break; if (*str == '"') { for (vbeg = ++str; --len > 0 && *str != '"'; str++) { if (*str == '\\') { --len; ++str; } } vend = str; if (len) { --len; ++str; } } else { for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++); vend = str; } while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++; n = end - beg; str_copy(name, beg, n); s = RSTRING_PTR(name); for (i = 0; i < n; ++i) { if (s[i] == '-') s[i] = '_'; } do { if (STRNCASECMP(p->name, s, n) == 0) { n = vend - vbeg; if (p->length) { n = (*p->length)(parser, vbeg, n); } str_copy(val, vbeg, n); (*p->func)(parser, s, RSTRING_PTR(val)); break; } } while (++p < magic_comments + numberof(magic_comments)); } return TRUE;}static voidset_file_encoding(struct parser_params *parser, const char *str, const char *send){ int sep = 0; const char *beg = str; VALUE s; for (;;) { if (send - str <= 6) return; switch (str[6]) { case 'C': case 'c': str += 6; continue; case 'O': case 'o': str += 5; continue; case 'D': case 'd': str += 4; continue; case 'I': case 'i': str += 3; continue; case 'N': case 'n': str += 2; continue; case 'G': case 'g': str += 1; continue; case '=': case ':': sep = 1; str += 6; break; default: str += 6; if (ISSPACE(*str)) break; continue; } if (STRNCASECMP(str-6, "coding", 6) == 0) break; } for (;;) { do { if (++str >= send) return; } while (ISSPACE(*str)); if (sep) break; if (*str != '=' && *str != ':') return; sep = 1; str++; } beg = str; while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send); s = rb_str_new(beg, parser_encode_length(parser, beg, str - beg)); parser_set_encode(parser, RSTRING_PTR(s)); rb_str_resize(s, 0);}static voidparser_prepare(struct parser_params *parser){ int c = nextc(); switch (c) { case '#': if (peek('!')) parser->has_shebang = 1; break; case 0xef: if (lex_pend - lex_p >= 2 && (unsigned char)lex_p[0] == 0xbb && (unsigned char)lex_p[1] == 0xbf) { parser->enc = rb_utf8_encoding(); lex_p += 2; lex_pbeg = lex_p; return; } break; case EOF: return; } pushback(c); parser->enc = rb_enc_get(lex_lastline);}#define IS_ARG() #define IS_END() #define IS_BEG() #define IS_SPCARG(c) #define IS_LABEL_POSSIBLE() #define IS_LABEL_SUFFIX(n) #define IS_AFTER_OPERATOR() #define ambiguous_operator(op, syn) #define warn_balanced(op, syn) static intparser_yylex(struct parser_params *parser){ register int c; int space_seen = 0; int cmd_state; enum lex_state_e last_state; rb_encoding *enc; int mb; if (lex_strterm) { int token; if (nd_type(lex_strterm) == NODE_HEREDOC) { token = here_document(lex_strterm); if (token == tSTRING_END) { lex_strterm = 0; lex_state = EXPR_END; } } else { token = parse_string(lex_strterm); if (token == tSTRING_END || token == tREGEXP_END) { rb_gc_force_recycle((VALUE)lex_strterm); lex_strterm = 0; lex_state = EXPR_END; } } return token; } cmd_state = command_start; command_start = FALSE; retry: last_state = lex_state; switch (c = nextc()) { case '\0': case '\004': case '\032': case -1: return 0; case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; goto retry; case '#': if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) { if (comment_at_top(parser)) { set_file_encoding(parser, lex_p, lex_pend); } } lex_p = lex_pend; case '\n': if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT)) { goto retry; } while ((c = nextc())) { switch (c) { case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; break; case '.': { if ((c = nextc()) != '.') { pushback(c); pushback('.'); goto retry; } } default: --ruby_sourceline; lex_nextline = lex_lastline; case -1: lex_goto_eol(parser); goto normal_newline; } } normal_newline: command_start = TRUE; lex_state = EXPR_BEG; return '\n'; case '*': if ((c = nextc()) == '*') { if ((c = nextc()) == '=') { set_yylval_id(tPOW); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`**' interpreted as argument prefix"); c = tDSTAR; } else if (IS_BEG()) { c = tDSTAR; } else { warn_balanced("**", "argument prefix"); c = tPOW; } } else { if (c == '=') { set_yylval_id('*'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`*' interpreted as argument prefix"); c = tSTAR; } else if (IS_BEG()) { c = tSTAR; } else { warn_balanced("*", "argument prefix"); c = '*'; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '!': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return '!'; } } else { lex_state = EXPR_BEG; } if (c == '=') { return tNEQ; } if (c == '~') { return tNMATCH; } pushback(c); return '!'; case '=': if (was_bol()) { if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) { for (;;) { lex_goto_eol(parser); c = nextc(); if (c == -1) { compile_error(PARSER_ARG "embedded document meets end of file"); return 0; } if (c != '=') continue; if (strncmp(lex_p, "end", 3) == 0 && (lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) { break; } } lex_goto_eol(parser); goto retry; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { if ((c = nextc()) == '=') { return tEQQ; } pushback(c); return tEQ; } if (c == '~') { return tMATCH; } else if (c == '>') { return tASSOC; } pushback(c); return '='; case '<': last_state = lex_state; c = nextc(); if (c == '<' && !IS_lex_state(EXPR_DOT | EXPR_CLASS) && !IS_END() && (!IS_ARG() || space_seen)) { int token = heredoc_identifier(); if (token) return token; } if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; } else { if (IS_lex_state(EXPR_CLASS)) command_start = TRUE; lex_state = EXPR_BEG; } if (c == '=') { if ((c = nextc()) == '>') { return tCMP; } pushback(c); return tLEQ; } if (c == '<') { if ((c = nextc()) == '=') { set_yylval_id(tLSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); warn_balanced("<<", "here document"); return tLSHFT; } pushback(c); return '<'; case '>': lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { return tGEQ; } if (c == '>') { if ((c = nextc()) == '=') { set_yylval_id(tRSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tRSHFT; } pushback(c); return '>'; case '"': lex_strterm = NEW_STRTERM(str_dquote, '"', 0); return tSTRING_BEG; case '`': if (IS_lex_state(EXPR_FNAME)) { lex_state = EXPR_ENDFN; return c; } if (IS_lex_state(EXPR_DOT)) { if (cmd_state) lex_state = EXPR_CMDARG; else lex_state = EXPR_ARG; return c; } lex_strterm = NEW_STRTERM(str_xquote, '`', 0); return tXSTRING_BEG; case '\'': lex_strterm = NEW_STRTERM(str_squote, '\'', 0); return tSTRING_BEG; case '?': if (IS_END()) { lex_state = EXPR_VALUE; return '?'; } c = nextc(); if (c == -1) { compile_error(PARSER_ARG "incomplete character syntax"); return 0; } if (rb_enc_isspace(c, current_enc)) { if (!IS_ARG()) { int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; case '\v': c2 = 'v'; break; case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2) { rb_warnI("invalid character syntax; use ?\\%c", c2); } } ternary: pushback(c); lex_state = EXPR_VALUE; return '?'; } newtok(); enc = current_enc; if (!parser_isascii()) { if (tokadd_mbchar(c) == -1) return 0; } else if ((rb_enc_isalnum(c, current_enc) || c == '_') && lex_p < lex_pend && is_identchar(lex_p, lex_pend, current_enc)) { goto ternary; } else if (c == '\\') { if (peek('u')) { nextc(); c = parser_tokadd_utf8(parser, &enc, 0, 0, 0); if (0x80 <= c) { tokaddmbc(c, enc); } else { tokadd(c); } } else if (!lex_eol_p() && !(c = *lex_p, ISASCII(c))) { nextc(); if (tokadd_mbchar(c) == -1) return 0; } else { c = read_escape(0, &enc); tokadd(c); } } else { tokadd(c); } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0)); lex_state = EXPR_END; return tCHAR; case '&': if ((c = nextc()) == '&') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tANDOP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tANDOP; } else if (c == '=') { set_yylval_id('&'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`&' interpreted as argument prefix"); c = tAMPER; } else if (IS_BEG()) { c = tAMPER; } else { warn_balanced("&", "argument prefix"); c = '&'; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '|': if ((c = nextc()) == '|') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tOROP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tOROP; } if (c == '=') { set_yylval_id('|'); lex_state = EXPR_BEG; return tOP_ASGN; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; pushback(c); return '|'; case '+': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUPLUS; } pushback(c); return '+'; } if (c == '=') { set_yylval_id('+'); lex_state = EXPR_BEG; return tOP_ASGN; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { c = '+'; goto start_num; } return tUPLUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("+", "unary operator"); return '+'; case '-': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUMINUS; } pushback(c); return '-'; } if (c == '=') { set_yylval_id('-'); lex_state = EXPR_BEG; return tOP_ASGN; } if (c == '>') { lex_state = EXPR_ENDFN; return tLAMBDA; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { return tUMINUS_NUM; } return tUMINUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("-", "unary operator"); return '-'; case '.': lex_state = EXPR_BEG; if ((c = nextc()) == '.') { if ((c = nextc()) == '.') { return tDOT3; } pushback(c); return tDOT2; } pushback(c); if (c != -1 && ISDIGIT(c)) { yyerror("no .<digit> floating literal anymore; put 0 before dot"); } lex_state = EXPR_DOT; return '.'; start_num: case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { int is_float, seen_point, seen_e, nondigit; is_float = seen_point = seen_e = nondigit = 0; lex_state = EXPR_END; newtok(); if (c == '-' || c == '+') { tokadd(c); c = nextc(); } if (c == '0') {#define no_digits() int start = toklen(); c = nextc(); if (c == 'x' || c == 'X') { c = nextc(); if (c != -1 && ISXDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISXDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 16, FALSE)); return tINTEGER; } if (c == 'b' || c == 'B') { c = nextc(); if (c == '0' || c == '1') { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c != '0' && c != '1') break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 2, FALSE)); return tINTEGER; } if (c == 'd' || c == 'D') { c = nextc(); if (c != -1 && ISDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE)); return tINTEGER; } if (c == '_') { goto octal_number; } if (c == 'o' || c == 'O') { c = nextc(); if (c == -1 || c == '_' || !ISDIGIT(c)) { no_digits(); } } if (c >= '0' && c <= '7') { octal_number: do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c < '0' || c > '9') break; if (c > '7') goto invalid_octal; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); if (toklen() > start) { pushback(c); tokfix(); if (nondigit) goto trailing_uc; set_yylval_literal(rb_cstr_to_inum(tok(), 8, FALSE)); return tINTEGER; } if (nondigit) { pushback(c); goto trailing_uc; } } if (c > '7' && c <= '9') { invalid_octal: yyerror("Invalid octal digit"); } else if (c == '.' || c == 'e' || c == 'E') { tokadd('0'); } else { pushback(c); set_yylval_literal(INT2FIX(0)); return tINTEGER; } } for (;;) { switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': nondigit = 0; tokadd(c); break; case '.': if (nondigit) goto trailing_uc; if (seen_point || seen_e) { goto decode_num; } else { int c0 = nextc(); if (c0 == -1 || !ISDIGIT(c0)) { pushback(c0); goto decode_num; } c = c0; } tokadd('.'); tokadd(c); is_float++; seen_point++; nondigit = 0; break; case 'e': case 'E': if (nondigit) { pushback(c); c = nondigit; goto decode_num; } if (seen_e) { goto decode_num; } tokadd(c); seen_e++; is_float++; nondigit = c; c = nextc(); if (c != '-' && c != '+') continue; tokadd(c); nondigit = c; break; case '_': if (nondigit) goto decode_num; nondigit = c; break; default: goto decode_num; } c = nextc(); } decode_num: pushback(c); if (nondigit) { char tmp[30]; trailing_uc: snprintf(tmp, sizeof(tmp), "trailing `%c' in number", nondigit); yyerror(tmp); } tokfix(); if (is_float) { double d = strtod(tok(), 0); if (errno == ERANGE) { rb_warningS("Float %s out of range", tok()); errno = 0; } set_yylval_literal(DBL2NUM(d)); return tFLOAT; } set_yylval_literal(rb_cstr_to_inum(tok(), 10, FALSE)); return tINTEGER; } case ')': case '] __pad18__ |
| stmt_or_begin __pad5__ |
| command_call __pad9__ |
| keyword_next call_args |
| primary_value tCOLON2 operation2 command_args cmd_brace_block |
| keyword_yield command_args |
| command_call |
| <num> opt_block_param compstmt |
| fixup_nodes& deferred_nodes |
| keyword_not opt_nl expr |
| keyword_BEGIN |
| mlhs_node keyword_variable |
| lhs |
| mlhs_inner mlhs_basic |
| mlhs_item |
| mlhs_post |
| nd_args = $2 |
Definition at line 1378 of file parse.y.
Referenced by dump_node(), and yyparse().
| nd_iter = $1 |
Definition at line 1388 of file parse.y.
Referenced by dump_node(), and yyparse().
| ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[] |
| ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[] |
| ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[] |
| ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding |
| ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[] |
| ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[] |
| error stmt |
| stmts terms stmt_or_begin |
| primary_value tCOLON2 operation2 command_args prec tLOWEST |
| error top_stmt |
1.8.2